koenvo commented on code in PR #1901: URL: https://github.com/apache/iceberg-python/pull/1901#discussion_r2036218488
########## pyiceberg/io/pyarrow.py: ########## @@ -1441,11 +1441,15 @@ def _task_to_record_batches( # Apply the user filter if pyarrow_filter is not None: - current_batch = current_batch.filter(pyarrow_filter) + # Temporary fix until PyArrow 21 is released ( https://github.com/apache/arrow/pull/46057 ) + table = pa.Table.from_batches([current_batch]) + table = table.filter(pyarrow_filter) # skip empty batches - if current_batch.num_rows == 0: + if table.num_rows == 0: continue + current_batch = table.combine_chunks().to_batches()[0] Review Comment: This was borrowed from the PyArrow code: https://github.com/apache/arrow/blob/main/python/pyarrow/acero.py#L379 My knowledge might be a bit limited to understand if it's needed in this case. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org