Fokko commented on code in PR #1901: URL: https://github.com/apache/iceberg-python/pull/1901#discussion_r2036213347
########## 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: I don't think we need to combine the chunks: ```suggestion current_batch = table.to_batches()[0] ``` -- 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