diff --git a/ibis/backends/tests/test_temporal.py b/ibis/backends/tests/test_temporal.py index a29a65129fb95..9d1ec03b6fe92 100644 --- a/ibis/backends/tests/test_temporal.py +++ b/ibis/backends/tests/test_temporal.py @@ -33,6 +33,20 @@ from ibis.common.annotations import ValidationError +def day_name(obj: pd.core.indexes.accessors.DatetimeProperties | pd.Timestamp) -> str: + """Backwards compatible name-of-day getting function. + + Returns + ------- + str + The name of the day corresponding to `obj` + """ + try: + return obj.day_name() + except AttributeError: + return obj.weekday_name + + def day_name(obj: pd.core.indexes.accessors.DatetimeProperties | pd.Timestamp) -> str: """Backwards compatible name-of-day getting function.