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

Fix discoverability of submodules inside pd.util #17215

Merged
merged 12 commits into from
Nov 4, 2024

Conversation

galipremsagar
Copy link
Contributor

Description

Fixes: #17166

This PR fixes the discoverability of the submodules of attributes and modules inside pd.util. Somehow importlib.import_module("pandas.util").__dict__ doesn't display submodules and only root level attributes.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@galipremsagar galipremsagar added bug Something isn't working 3 - Ready for Review Ready for review by team Python Affects Python cuDF API. non-breaking Non-breaking change labels Oct 30, 2024
@galipremsagar galipremsagar self-assigned this Oct 30, 2024
@galipremsagar galipremsagar requested a review from a team as a code owner October 30, 2024 22:43
@github-actions github-actions bot added the cudf.pandas Issues specific to cudf.pandas label Oct 30, 2024
@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Oct 31, 2024
@galipremsagar
Copy link
Contributor Author

/merge

@Matt711
Copy link
Contributor

Matt711 commented Oct 31, 2024

The errors I'm seeing are

ERROR python/cudf/cudf_pandas_tests/test_array_function.py - AttributeError: module 'pandas.util' has no attribute 'capitalize_first_letter'
ERROR python/cudf/cudf_pandas_tests/test_cudf_pandas.py - AttributeError: module 'pandas.util' has no attribute 'capitalize_first_letter'
ERROR python/cudf/cudf_pandas_tests/test_cudf_pandas_cudf_interop.py - AttributeError: module 'pandas.util' has no attribute 'capitalize_first_letter'
ERROR python/cudf/cudf_pandas_tests/test_cudf_pandas_no_fallback.py - AttributeError: module 'pandas.util' has no attribute 'capitalize_first_letter'
ERROR python/cudf/cudf_pandas_tests/test_profiler.py - AttributeError: module 'pandas.util' has no attribute 'capitalize_first_letter'

which is coming from https://github.com/rapidsai/cudf/blob/branch-24.12/python/cudf/cudf/pandas/module_accelerator.py#L458.

Edit: capitalize_first_letter is not defined in __getattr__ https://github.com/pandas-dev/pandas/blob/2.2.x/pandas/util/__init__.py

@mroeschke
Copy link
Contributor

Noting that there will be discrepancies depending on pandas 2.x version

pandas 2.2 (and upcoming 2.3) will have capitalize_first_letter

pandas 2.0, 2.1 (and upcoming 3.0) will not have capitalize_first_letter

@galipremsagar
Copy link
Contributor Author

/okay to test

@rapids-bot rapids-bot bot merged commit 1d25d14 into rapidsai:branch-24.12 Nov 4, 2024
102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working cudf.pandas Issues specific to cudf.pandas non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] Series.plot method populates pd.util.version when run under cudf.pandas
3 participants