Commits


Alenka Frim authored and Joris Van den Bossche committed 0ee3449e8b5
ARROW-14765: [Python] StructFieldOptions not exposed In this PR I added `StructFieldOptions` binding and two small typo corrections for `TypeError` message in `compute.py`. What I haven't managed to solve and would ask for suggestions is the case when options are not specified. Example: ```python import pyarrow as pa import pyarrow.compute as pc a = pa.array([4, 5, 6], type=pa.int64()) b = pa.array(["bar", None, ""]) c = pa.StructArray.from_arrays([a, b], ["a", "b"]) arr = pa.StructArray.from_arrays([a, c], ["a", "c"]) pc.struct_field(arr) ``` This error I get: ```python-traceback >>> pc.struct_field(arr) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/alenkafrim/repos/arrow/python/pyarrow/compute.py", line 202, in wrapper return func.call(args, options, memory_pool) File "pyarrow/_compute.pyx", line 327, in pyarrow._compute.Function.call result = GetResultValue( File "pyarrow/error.pxi", line 143, in pyarrow.lib.pyarrow_internal_check_status return check_status(status) File "pyarrow/error.pxi", line 99, in pyarrow.lib.check_status raise ArrowInvalid(message) pyarrow.lib.ArrowInvalid: Attempted to initialize KernelState from null FunctionOptions ``` For which I tried to add https://github.com/AlenkaF/arrow/blob/bec0a6beac3415e03400088a3269f3be3fc7150c/python/pyarrow/_compute.pyx#L977-L978 but it doesn't seem to help. Closes #11765 from AlenkaF/ARROW-14765 Authored-by: Alenka Frim <frim.alenka@gmail.com> Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>