Skip to content

Replace pkg_resources in datasets/data_loader.py - #65

Open
itzzdev09 wants to merge 1 commit into
StatMixedML:masterfrom
itzzdev09:drop-pkg-resources
Open

itzzdev09 wants to merge 1 commit into
StatMixedML:masterfrom
itzzdev09:drop-pkg-resources

Conversation

@itzzdev09

Copy link
Copy Markdown

datasets/data_loader.py does import pkg_resources at module level and reads the bundled CSVs with pkg_resources.resource_stream. setuptools 82 removed pkg_resources, so importing the module (and calling any load_* data function) fails with ModuleNotFoundError: No module named 'pkg_resources' on a current setuptools.

This reads the CSVs through importlib.resources.files(__package__) and closes the file after reading. I compared every load_* function against the old implementation (setuptools 81) using the real CSV files, and the returned DataFrames are identical (DataFrame.equals).

This branch has not been deployed

No deployments
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.

1 participant