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 committed Apr 21, 2024
1 parent c3ae9b7 commit e1d5bc9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion ibis/backends/sqlite/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,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 @@ -1480,7 +1480,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 @@ -1512,9 +1512,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 e1d5bc9

Please sign in to comment.