From b15a6feb64fc519d5df9bbb59c8ec3443298e6ef Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Tue, 25 Apr 2023 09:29:44 -0400 Subject: [PATCH] feat(snowflake): implement proper approx median --- ibis/backends/snowflake/registry.py | 1 + ibis/backends/tests/test_aggregation.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ibis/backends/snowflake/registry.py b/ibis/backends/snowflake/registry.py index 991e6c7a4be9..8a864e76c766 100644 --- a/ibis/backends/snowflake/registry.py +++ b/ibis/backends/snowflake/registry.py @@ -389,6 +389,7 @@ def _group_concat(t, op): ops.EndsWith: fixed_arity(sa.func.endswith, 2), ops.GroupConcat: _group_concat, ops.Hash: unary(sa.func.hash), + ops.ApproxMedian: reduction(lambda x: sa.func.approx_percentile(x, 0.5)), } ) diff --git a/ibis/backends/tests/test_aggregation.py b/ibis/backends/tests/test_aggregation.py index e3d3716dc673..0150f25b0e2a 100644 --- a/ibis/backends/tests/test_aggregation.py +++ b/ibis/backends/tests/test_aggregation.py @@ -1010,7 +1010,7 @@ def test_corr_cov( @pytest.mark.notimpl( - ["datafusion", "mysql", "sqlite", "snowflake", "mssql", "druid"], + ["datafusion", "mysql", "sqlite", "mssql", "druid"], raises=com.OperationNotDefinedError, ) @pytest.mark.broken(