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

Show a warning when uploading a Geo/DataFrame without geometry #1650

Merged

Conversation

josemazo
Copy link
Contributor

Story ch59311

@josemazo josemazo requested a review from Jesus89 June 15, 2020 16:37
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.

The to_carto function allows passing the geom_col param, so the detection of the geometry column must be done after the geometry setup. We can have also situations with a GeoDataFrame without a valid geometry column, or a GeoDataFrame with a geometry column different than the_geom (by default is geometry).

So IMO, we should remove the is_geodataframe flag detection and the first warning, and keep only the last one with a slightly different content:

if has_geometry(gdf):
   ...
elif isinstance(dataframe, GeoDataFrame):
   log.warning('Geometry column not found in the GeoDataFrame.')

@josemazo
Copy link
Contributor Author

Totally right! Ready for review again.

cartoframes/io/carto.py Outdated Show resolved Hide resolved
@Jesus89 Jesus89 merged commit 304a634 into develop Jun 16, 2020
@Jesus89 Jesus89 deleted the josema/ch59311/warning-upload-carto-and-no-geom-column-found branch June 16, 2020 08:55
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.

None yet

2 participants