Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timestamptz read carto #1720

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Fix timestamptz read carto #1720

merged 2 commits into from
Mar 5, 2021

Conversation

Mmoncadaisla
Copy link
Contributor

Context

In this small PR from Support we aim to fix a small bug in the pg2dtypes function which causes timestamp with time zone dtypes columns to be read as object data type columns in GeoPandas.

Further details can be found in this CH story.

PR changes

  • utils: fix the small typo causing the error for timestamptz dtype
  • test_utils: fix corresponding unit test

Result with PR changes

>>> import cartoframes
>>> cartoframes.auth.set_default_credentials(username='mmoncada', api_key='1d9f28a0e83f7793c371ecc4cd4be5e87ac0687c')
>>> gdf = cartoframes.read_carto('test_timestamptz_cartoframes')
>>> gdf.dtypes
cartodb_id                  int64
the_geom                 geometry
field_1                     int64
county_fip                  int64
fips                        int64
housing_un                 object
county                     object
state_name                 object
created_at    datetime64[ns, UTC]
updated_at    datetime64[ns, UTC]
state_fips                  int64
monday                      int64
tuesday                     int64
wednesday                   int64
thursday                    int64
dtype: object

@Mmoncadaisla Mmoncadaisla requested a review from Jesus89 March 5, 2021 15:22
@Mmoncadaisla Mmoncadaisla self-assigned this Mar 5, 2021
Copy link
Member

@Jesus89 Jesus89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@Jesus89 Jesus89 merged commit 091e5e4 into develop Mar 5, 2021
@Jesus89 Jesus89 deleted the fix_timestamptz_read_carto branch March 5, 2021 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants