From 9a2563bf5a0ff498ec3054b8ca1a6f3c6fda1d48 Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Fri, 9 Aug 2024 11:50:16 -0400 Subject: [PATCH] feat(polars): array sort --- ibis/backends/polars/compiler.py | 6 ++++++ ibis/backends/tests/test_array.py | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ibis/backends/polars/compiler.py b/ibis/backends/polars/compiler.py index 3b1d21ab0980..8216788e2294 100644 --- a/ibis/backends/polars/compiler.py +++ b/ibis/backends/polars/compiler.py @@ -955,6 +955,12 @@ def timestamp_diff(op, **kw): return left.dt.truncate("1s") - right.dt.truncate("1s") +@translate.register(ops.ArraySort) +def array_sort(op, **kw): + arg = translate(op.arg, **kw) + return arg.list.sort() + + @translate.register(ops.ArrayLength) def array_length(op, **kw): arg = translate(op.arg, **kw) diff --git a/ibis/backends/tests/test_array.py b/ibis/backends/tests/test_array.py index 7c373fd59f53..eac018309ddd 100644 --- a/ibis/backends/tests/test_array.py +++ b/ibis/backends/tests/test_array.py @@ -718,7 +718,6 @@ def test_array_unique(con, input, expected): @builtin_array -@pytest.mark.notimpl(["polars"], raises=com.OperationNotDefinedError) @pytest.mark.notyet( ["risingwave"], raises=AssertionError,