arrow icon indicating copy to clipboard operation
arrow copied to clipboard

[Python][Acero] RecordBatch.filter on expression raises error if result set is empty

Open wlhjason opened this issue 1 year ago • 0 comments

Describe the bug, including details regarding any error messages, version, and platform.

Example (tested with pyarrow 17.0.0):

import pyarrow as pa
import pyarrow.compute as pc

pa.record_batch({"number": [1, 2, 3]}).filter(pc.field("number") < 0)

leads to

IndexError: list index out of range

on this line in arrow/python/pyarrow/acero.py: https://github.com/apache/arrow/blob/maint-17.0.0/python/pyarrow/acero.py#L371

Component(s)

Python

wlhjason avatar Oct 10 '24 08:10 wlhjason