Skip to content

Commit

Permalink
try fix for sqlite & exasol
Browse files Browse the repository at this point in the history
  • Loading branch information
kaijennissen authored and cpcloud committed Jul 15, 2024
1 parent 2e95aca commit 6b3c1cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion ibis/backends/sql/compilers/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions ibis/backends/tests/test_temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 6b3c1cc

Please sign in to comment.