Skip to content

Commit

Permalink
Also check condition in make_filter for None
Browse files Browse the repository at this point in the history
  • Loading branch information
wjones127 committed Dec 9, 2021
1 parent 14752e4 commit 88e65b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions python/pyarrow/gandiva.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ cpdef make_projector(Schema schema, children, MemoryPool pool,

cpdef make_filter(Schema schema, Condition condition):
cdef shared_ptr[CFilter] result
if condition is None:
raise TypeError("Condition must not be None")
check_status(
Filter_Make(schema.sp_schema, condition.condition, &result))
return Filter.create(result)
Expand Down
2 changes: 1 addition & 1 deletion python/pyarrow/tests/test_gandiva.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,5 +428,5 @@ def test_rejects_none():
with pytest.raises(TypeError):
gandiva.make_projector(schema, [None])

with pytest.raises(pa.lib.ArrowInvalid):
with pytest.raises(TypeError):
gandiva.make_filter(schema, None)

0 comments on commit 88e65b4

Please sign in to comment.