Replace deprecated pkg_resources with importlib.resources for resource loading(#GH 645)#646
Conversation
|
I really appreciate this PR. It would be great to get a release that includes this and the updated a11y-compatible color palette next week! Before semesters start kicking in. Thanks. |
|
@sean-morris -- Thank you for your feedback! |
|
Can @adnanhemani or another maintainer review / approve this PR? Looking to avoid seeing this error message all semester if possible. Thanks! |
|
Thank you @taylorgibson for the support! Please let me know if there’s any feedback , I’d be happy to adjust the changes if needed. |
pancakereport
left a comment
There was a problem hiding this comment.
minor changes so i'm approving. if something breaks we'll roll back.
|
@sean-morris @taylorgibson I have released a new version of the datascience package, which contains this update. Update to version 0.18.0 (the latest version), and it should now contain this. Please test. It's been a while since we pushed out a new release, this also includes a few other unrelated minor bugfixes, so please test to make sure everything is still working. |
|
Thanks! |
|
@davidwagner this hasn't yet been pushed to conda... i'm curious when that will happen. https://anaconda.org/conda-forge/datascience |
|
Thanks @davidwagner , I'll take a look and see if everything still seems good. |
|
@davidwagner we have it deployed across 30 hubs and everything seems to be working |
|
@shaneknapp I don't know how to push to conda, alas, so maybe never, unless someone is able to teach me how to do that. My apologies... |
(#645)
This PR replaces the deprecated pkg_resources.resource_filename usage in get_coordinates (maps.py) with the modern importlib.resources API to load geocode_states.csv. This change addresses the deprecation warning triggered during import of the datascience package and ensures forward compatibility with Python and setuptools releases after November 2025, where pkg_resources will be removed.
Please let me know if my approach or fix needs any improvements . I’m open to feedback and happy to make changes based on suggestions.
Thankyou !