Skip to content

Commit

Permalink
fix: raise AttributeError instead of returning None on __getattr__ (#329
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`.

This error was introduced in the 0.5.0 release.
  • Loading branch information
tdstein authored Nov 12, 2024
1 parent f16a90c commit 32fd323
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 @@ -45,7 +45,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 32fd323

Please sign in to comment.