Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/pyarrow/_compute.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ cdef class FunctionOptions(_Weakrefable):
return pyarrow_wrap_buffer(c_buf)

@staticmethod
def deserialize(buf):
def deserialize(Buffer buf not None):
"""
Deserialize options for a function.

Expand Down
6 changes: 6 additions & 0 deletions python/pyarrow/tests/test_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ def test_option_class_equality(request):
"ArraySortOptions(order=Ascending, null_placement=AtEnd)"


@pytest.mark.parametrize("value", [None, 1, [], b""])
def test_function_options_deserialize_rejects_non_buffers(value):
with pytest.raises(TypeError):
pc.FunctionOptions.deserialize(value)


def test_list_functions():
assert len(pc.list_functions()) > 10
assert "add" in pc.list_functions()
Expand Down