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(MetaflowData): Raise AttributeError on failed __getattr__ access #1971

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

mutongx
Copy link
Contributor

@mutongx mutongx commented Aug 20, 2024

Python's custom attribute access protocol requires AttributeError to be raised on access failure (docs link). The current implement propagates KeyError from dict, which breaks hasattr() operations on MetaflowData.

This PR checks for key existence and raise the correct exception in MetaflowData.__getattr__.

Fixes #1970.

@romain-intel
Copy link
Contributor

LGTM. We can merge shortly

@savingoyal savingoyal merged commit 2bf2a61 into Netflix:master Aug 20, 2024
25 of 26 checks passed
@mutongx mutongx deleted the patch-1 branch August 21, 2024 05:07
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.

MetaflowData.__getattr__ should raise AttributeError on failure
3 participants