Skip to content

Commit

Permalink
Added array_contains test to regress 1115
Browse files Browse the repository at this point in the history
  • Loading branch information
westonpace committed Jan 8, 2024
1 parent 7440e4c commit c07a427
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/python/tests/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,13 @@ def test_functions(tmp_path: Path):
expected = table.slice(1, 2)
dataset = lance.write_dataset(table, tmp_path / "test_neg_expr")
assert (
dataset.scanner(
filter="array_has_any(genres, Array['anime', 'adventure'])"
).to_table()
dataset.to_table(filter="array_has_any(genres, Array['anime', 'adventure'])")
== expected
)

expected = table.slice(0, 1)
assert dataset.to_table(filter="array_contains(genres, 'comedy')") == expected


def test_negative_expressions(tmp_path: Path):
table = pa.table({"x": [-1, 0, 1, 1], "y": [1, 2, 3, 4]})
Expand Down

0 comments on commit c07a427

Please sign in to comment.