Skip to content

Commit 32fd323

Browse files
authored
fix: raise AttributeError instead of returning None on __getattr__ (#329)
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.
1 parent f16a90c commit 32fd323

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/posit/connect/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __getattr__(self, name):
4545
stacklevel=2,
4646
)
4747
return self[name]
48-
return None
48+
raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")
4949

5050
def update(self, *args, **kwargs):
5151
super().update(*args, **kwargs)

0 commit comments

Comments
 (0)