-
Notifications
You must be signed in to change notification settings - Fork 4.3k
[Python] get_partition_keys segfaults when the partition expression is None #51293
Open
Assignees
Labels
Description
Describe the bug, including details regarding any error messages, version, and platform.
pyarrow.dataset.get_partition_keys takes an Expression but does not reject
None, so passing it dereferences a null pointer and terminates the interpreter
rather than raising.
import pyarrow.dataset as ds ds.get_partition_keys(None)
$ python -c "import pyarrow.dataset as ds; ds.get_partition_keys(None)"; echo "exit=$?" Bus error: 10 exit=138
The same call through the private alias ds._get_partition_keys(None) crashes
identically.
This is the same class of problem as GH-51042 and GH-51043, where a required
Arrow wrapper argument was not declared not None at the Cython boundary. A
sweep of the remaining Cython bindings for required wrapper-typed parameters
without not None found this as the one still reachable from a public entry
point.
Expected behavior is a TypeError, consistent with other typed PyArrow APIs.
PyArrow 25.0.1, CPython 3.11, macOS arm64.
Component(s)
Python