diff --git a/ibis/backends/sqlite/compiler.py b/ibis/backends/sqlite/compiler.py index d7432170db540..a399398188328 100644 --- a/ibis/backends/sqlite/compiler.py +++ b/ibis/backends/sqlite/compiler.py @@ -415,7 +415,14 @@ def visit_DayOfWeekIndex(self, op, *, arg): ) def visit_IsoDayOfWeekIndex(self, op, *, arg): - return self.cast(self.f.strftime("%u", arg), dt.int64) + # return self.cast(self.f.strftime("%u", arg), dt.int64) + return ( + self.cast( + self.f.mod(self.cast(self.f.strftime("%w", arg) + 6, dt.int64), 7), + dt.int64, + ) + + 1 + ) def visit_DayOfWeekName(self, op, *, arg): return sge.Case( diff --git a/ibis/backends/tests/test_temporal.py b/ibis/backends/tests/test_temporal.py index 87fe65f148033..e3b17172a1ead 100644 --- a/ibis/backends/tests/test_temporal.py +++ b/ibis/backends/tests/test_temporal.py @@ -1599,7 +1599,7 @@ def test_day_of_week_scalar( raises=AttributeError, reason="StringColumn' object has no attribute 'day_of_week'", ) -@pytest.mark.notimpl(["exasol"], raises=com.OperationNotDefinedError) +# @pytest.mark.notimpl(["exasol"], raises=com.OperationNotDefinedError) @pytest.mark.broken( ["risingwave"], raises=AssertionError, @@ -1631,9 +1631,9 @@ def test_day_of_week_column(backend, alltypes, df): lambda t: t.timestamp_col.day_of_week.index().count(), lambda s: s.dt.dayofweek.count(), id="day_of_week_index", - marks=[ - pytest.mark.notimpl(["exasol"], raises=com.OperationNotDefinedError) - ], + # marks=[ + # pytest.mark.notimpl(["exasol"], raises=com.OperationNotDefinedError) + # ], ), param( lambda t: t.timestamp_col.day_of_week.full_name().length().sum(),