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: raise AttributeError instead of returning None on __getattr__ #329

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

tdstein
Copy link
Collaborator

@tdstein tdstein commented Nov 12, 2024

The __getattr__ method should always raise an AttributeError if the value does not exist instead of returning None. The existing implementation causes issues when converting to a Pandas DataFrame.

This error was introduced in the 0.5.0 release.

The __getattr__ method should always raise an AttributeError if the value does not exist instead of returning None. The existing implementation causes issues when converting to a Pandas DataFrame
Copy link

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1427 1356 95% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/posit/connect/resources.py 89% 🟢
TOTAL 89% 🟢

updated for commit: 1d9bec0 by action🐍

@tdstein tdstein marked this pull request as ready for review November 12, 2024 14:56
@tdstein tdstein added bug Something isn't working sdk Used for automation labels Nov 12, 2024
@tdstein tdstein added this to the 0.6.0 milestone Nov 12, 2024
@zackverham
Copy link
Collaborator

Seems simple enough! Any reason to try to capture this behavior in a test somewhere? Its generic enough that the answer might be no.

@tdstein
Copy link
Collaborator Author

tdstein commented Nov 12, 2024

Seems simple enough! Any reason to try to capture this behavior in a test somewhere? Its generic enough that the answer might be no.

Eh, that code block will be gone soon enough. Probably not worth the effort at this point.

@tdstein tdstein merged commit 32fd323 into main Nov 12, 2024
35 checks passed
@tdstein tdstein deleted the tdstein/fix-getattr branch November 12, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sdk Used for automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants