Skip to content

Commit

Permalink
feat(duckdb): implement now() function
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed Mar 7, 2022
1 parent c93680e commit 6924f50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions ibis/backends/duckdb/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,6 @@ def _struct_field(t, expr):
ops.TimestampDiff: fixed_arity('age', 2),
ops.TimestampFromUNIX: _timestamp_from_unix,
ops.Translate: fixed_arity('replace', 3),
ops.TimestampNow: fixed_arity('now', 0),
}
)
6 changes: 3 additions & 3 deletions ibis/backends/tests/test_temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def test_day_of_week_column_group_by(
backend.assert_frame_equal(result, expected, check_dtype=False)


@pytest.mark.notimpl(["datafusion", "duckdb"])
@pytest.mark.notimpl(["datafusion"])
def test_now(backend, con):
expr = ibis.now()
result = con.execute(expr)
Expand All @@ -593,8 +593,8 @@ def test_now(backend, con):


@pytest.mark.notimpl(["dask"], reason="Limit #2553")
@pytest.mark.notimpl(["datafusion", "duckdb"])
def test_now_from_projection(backend, con, alltypes, df):
@pytest.mark.notimpl(["datafusion"])
def test_now_from_projection(backend, alltypes):
n = 5
expr = alltypes[[ibis.now().name('ts')]].limit(n)
result = expr.execute()
Expand Down

0 comments on commit 6924f50

Please sign in to comment.