Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions narwhals/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1277,11 +1277,8 @@ def dtype_matches_time_unit_and_time_zone(


def _hasattr_static(obj: Any, attr: str) -> bool:
try:
getattr_static(obj, attr)
except AttributeError:
return False
return True
sentinel = object()
return getattr_static(obj, attr, sentinel) is not sentinel


def is_compliant_dataframe(obj: Any) -> TypeIs[CompliantDataFrame]:
Expand Down
Loading