Skip to content

Commit

Permalink
fix: raise AttributeError instead of returning None on __getattr__.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tdstein committed Nov 12, 2024
1 parent e361a28 commit 1d9bec0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/posit/connect/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __getattr__(self, name):
stacklevel=2,
)
return self[name]
return None
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

def update(self, *args, **kwargs):
super().update(*args, **kwargs)
Expand Down

0 comments on commit 1d9bec0

Please sign in to comment.