koenvo opened a new pull request, #46057: URL: https://github.com/apache/arrow/pull/46057
### Rationale for this change When filtering a RecordBatch using an expression that results in zero matching rows, an IndexError was raised due to an attempt to access the first batch of an empty result. This change ensures that such cases are handled gracefully by returning an empty RecordBatch with the correct schema. ### What changes are included in this PR? Fixed a bug in _filter_table where filtering all rows from a RecordBatch would raise an IndexError. Added a helper function _empty_record_batch_from_schema to construct an empty RecordBatch with the correct schema. ### Are these changes tested? Yes, the behavior was verified manually. Let me know if you'd like a dedicated test case added to the test suite. ### Are there any user-facing changes? No changes to public APIs. The fix ensures more robust handling of edge cases internally. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
