Skip to content

Commit eb14daa

Browse files
IndexSeekcpcloud
authored andcommitted
feat(polars): add ArrayContains operation
1 parent 43dfe38 commit eb14daa

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ibis/backends/polars/compiler.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1514,3 +1514,10 @@ def normalize_index(index, length):
15141514
slice_len = pl.when(stop > start).then(stop - start).otherwise(0)
15151515

15161516
return arg.list.slice(start, slice_len)
1517+
1518+
1519+
@translate.register(ops.ArrayContains)
1520+
def visit_ArrayContains(op, **kw):
1521+
arg = translate(op.arg, **kw)
1522+
value = translate(op.other, **kw)
1523+
return arg.list.contains(value)

ibis/backends/tests/test_array.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,6 @@ def test_array_filter_with_index(con, input, output, predicate):
616616

617617

618618
@builtin_array
619-
@pytest.mark.notimpl(["polars"], raises=com.OperationNotDefinedError)
620619
@pytest.mark.parametrize(
621620
("col", "value"),
622621
[

0 commit comments

Comments
 (0)