You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR resolves a lingering todo comment in src/h3/_h3shape.py.
The geo_to_h3shape function contained a debug assertion (assert isinstance(geo, dict) # todo: remove) that was explicitly marked for removal.
To improve robustness, I replaced the raw assertion with a proper ValueError check to prevent confusing TypeError crashes if a user accidentally passes a string. I also added a unit test to test_polyfill.py to ensure this specific bad input is caught correctly.
I noticed the assert in geo_to_h3shape was recently updated to a ValueError on master, but there wasn't a specific test for it. This PR adds a unit test to test_polyfill.py to ensure this ValueError correctly catches invalid string inputs.
I've resolved the merge conflicts and fixed the CI linter error!
Just to recap: it looks like the ValueError fix in _h3shape.py was recently merged into master, so I accepted those incoming changes during the conflict resolution. This PR now strictly adds the missing unit test to test_polyfill.py to ensure that specific ValueError is properly tested against invalid string inputs.
The tests should be completely green now and ready for review!
Thanks for putting this together! If there’s anything else you’d like me to tweak or update, just let me know.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves a lingering
todocomment insrc/h3/_h3shape.py.The
geo_to_h3shapefunction contained a debug assertion (assert isinstance(geo, dict) # todo: remove) that was explicitly marked for removal.To improve robustness, I replaced the raw assertion with a proper
ValueErrorcheck to prevent confusingTypeErrorcrashes if a user accidentally passes a string. I also added a unit test totest_polyfill.pyto ensure this specific bad input is caught correctly.Maintainers
cc: @dfellis @ajfriend @isaacbrodsky