From e73a99328d716975604ec79edd31907d8a644517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kriszti=C3=A1n=20Sz=C5=B1cs?= Date: Wed, 13 Dec 2023 12:26:42 +0100 Subject: [PATCH] test(ir): ensure that no backends are required to run the core tests --- ibis/backends/tests/test_temporal.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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.