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

Update shapely usage to avoid deprecation #276

Merged

Conversation

frafra
Copy link
Contributor

@frafra frafra commented Feb 17, 2022

Work based on PR #272.

@frafra
Copy link
Contributor Author

frafra commented Feb 18, 2022

The only potential problem I see, is that the error message for an invalid geometry is a bit too generic.
shape('{"Type":"Bad_GeoJSON","a":2}') would show AttributeError: 'NoneType' object has no attribute 'lower', which is not so great. An alternative would be to catch AttributeError as an exception and write something like Invalid geometry.

@frafra frafra force-pushed the update-shapely-usage-to-avoid-deprecation branch from 34d89e0 to e212662 Compare February 18, 2022 09:38
@frafra frafra force-pushed the update-shapely-usage-to-avoid-deprecation branch from e212662 to df3af62 Compare February 18, 2022 09:42
@frafra
Copy link
Contributor Author

frafra commented Feb 18, 2022

Instead of changing the tests, I changed the error handling in the code, and wrote a meaningful error message.

That seems good enough for me :)

@mutantsan
Copy link
Contributor

Thanks, @frafra !
I couldn't find the time to fix the tests. I'm glad that you found the issue.

@amercader amercader merged commit 0594fdf into ckan:master Feb 18, 2022
@frafra frafra deleted the update-shapely-usage-to-avoid-deprecation branch February 18, 2022 15:26
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.

3 participants