Skip to content

Commit

Permalink
feat(polars): add ArrayRemove operation (#10322)
Browse files Browse the repository at this point in the history
  • Loading branch information
IndexSeek authored Oct 16, 2024
1 parent eb14daa commit 81d3179
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ibis/backends/polars/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1521,3 +1521,10 @@ def visit_ArrayContains(op, **kw):
arg = translate(op.arg, **kw)
value = translate(op.other, **kw)
return arg.list.contains(value)


@translate.register(ops.ArrayRemove)
def visit_ArrayRemove(op, **kw):
arg = translate(op.arg, **kw)
value = _literal_value(op.other)
return arg.list.set_difference(pl.lit([value]))
1 change: 0 additions & 1 deletion ibis/backends/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,6 @@ def test_array_position(con, a, expected_array):


@builtin_array
@pytest.mark.notimpl(["polars"], raises=com.OperationNotDefinedError)
@pytest.mark.parametrize(
("input", "expected"),
[
Expand Down

0 comments on commit 81d3179

Please sign in to comment.