Skip to content

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

@wlhjason

Description

@wlhjason

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions