Skip to content

Commit

Permalink
feat(clickhouse): implement ops.RandomScalar
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-kwitt authored and cpcloud committed Feb 5, 2023
1 parent a507d17 commit 104aeed
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
1 change: 1 addition & 0 deletions ibis/backends/clickhouse/compiler/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,7 @@ def formatter(op, **kw):
ops.Tan: "tan",
ops.Pi: "pi",
ops.E: "e",
ops.RandomScalar: "randCanonical",
# Unary aggregates
ops.ApproxMedian: "median",
# TODO: there is also a `uniq` function which is the
Expand Down
4 changes: 0 additions & 4 deletions ibis/backends/tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,6 @@ def test_order_by(backend, alltypes, df, key, df_kwargs):


@pytest.mark.notimpl(["dask", "datafusion", "impala", "pandas", "polars", "mssql"])
@pytest.mark.notyet(
["clickhouse"],
reason="clickhouse doesn't have a [0.0, 1.0) random implementation",
)
def test_order_by_random(alltypes):
expr = alltypes.filter(_.id < 100).order_by(ibis.random()).limit(5)
r1 = expr.execute()
Expand Down
4 changes: 0 additions & 4 deletions ibis/backends/tests/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,6 @@ def test_sa_default_numeric_precision_and_scale(


@pytest.mark.notimpl(["dask", "datafusion", "impala", "pandas", "sqlite", "polars"])
@pytest.mark.notyet(
["clickhouse"],
reason="backend doesn't implement a [0.0, 1.0) or [0.0, 1.0] RANDOM() function",
)
def test_random(con):
expr = ibis.random()
result = con.execute(expr)
Expand Down

0 comments on commit 104aeed

Please sign in to comment.