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

Patch all module attributes in its namespace #3727

Merged
merged 1 commit into from
Feb 17, 2022
Merged

Conversation

albertvillanova
Copy link
Member

@albertvillanova albertvillanova commented Feb 15, 2022

When patching module attributes, only those defined in its __all__ variable were considered by default (only falling back to __dict__ if __all__ was None).

However those are only a subset of all the module attributes in its namespace (__dict__ variable).

This PR fixes the problem of modules that have non-None __all__ variable, but try to access an attribute present in __dict__ (and not in __all__).

For example, pandas has attribute __version__ only present in __dict__.

  • Before version 1.4, pandas __all__ was None, thus all attributes in __dict__ were patched
  • From version 1.4, pandas __all__ is not None, thus attributes in __dict__ not present in __all__ are ignored

Fix #3724.

CC: @severo @lvwerra

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch !

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.

Bug while streaming CSV dataset with pandas 1.4
2 participants