Skip to content

Commit 104aeed

Browse files
krzysztof-kwittcpcloud
authored andcommitted
feat(clickhouse): implement ops.RandomScalar
1 parent a507d17 commit 104aeed

File tree

3 files changed

+1
-8
lines changed

3 files changed

+1
-8
lines changed

ibis/backends/clickhouse/compiler/values.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,7 @@ def formatter(op, **kw):
998998
ops.Tan: "tan",
999999
ops.Pi: "pi",
10001000
ops.E: "e",
1001+
ops.RandomScalar: "randCanonical",
10011002
# Unary aggregates
10021003
ops.ApproxMedian: "median",
10031004
# TODO: there is also a `uniq` function which is the

ibis/backends/tests/test_generic.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,6 @@ def test_order_by(backend, alltypes, df, key, df_kwargs):
504504

505505

506506
@pytest.mark.notimpl(["dask", "datafusion", "impala", "pandas", "polars", "mssql"])
507-
@pytest.mark.notyet(
508-
["clickhouse"],
509-
reason="clickhouse doesn't have a [0.0, 1.0) random implementation",
510-
)
511507
def test_order_by_random(alltypes):
512508
expr = alltypes.filter(_.id < 100).order_by(ibis.random()).limit(5)
513509
r1 = expr.execute()

ibis/backends/tests/test_numeric.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,6 @@ def test_sa_default_numeric_precision_and_scale(
543543

544544

545545
@pytest.mark.notimpl(["dask", "datafusion", "impala", "pandas", "sqlite", "polars"])
546-
@pytest.mark.notyet(
547-
["clickhouse"],
548-
reason="backend doesn't implement a [0.0, 1.0) or [0.0, 1.0] RANDOM() function",
549-
)
550546
def test_random(con):
551547
expr = ibis.random()
552548
result = con.execute(expr)

0 commit comments

Comments
 (0)