You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python][Parquet] ParquetFile.iter_batches errors when row_groups is [] #45343
Describe the bug, including details regarding any error messages, version, and platform.
As of version 18.0.0, ParquetFile.iter_batches throws an error when the row_groups parameter is an empty list.
This can be replicated with the following code (also available here).
from pathlib import Path
from pyarrow import parquet as pq
pq_file = pq.ParquetFile(Path('pyarrow-issue.parquet'))
all_batches = []
for batch in pq_file.iter_batches(row_groups=[]):
all_batches.append(batch)
The stack trace is:
Traceback (most recent call last):
File "/pyarrow-issue.py", line 9, in <module>
for batch in pq_file.iter_batches(row_groups=[]):
File "pyarrow/_parquet.pyx", line 1634, in iter_batches
File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status
OSError: The file only has 1 row groups, requested metadata for row group: -1
Have also seen the issue in PyArrow v18.1.0 and v19.0.0, but v17.0.0 does not have the issue. We are on Python version 3.12.3, running within WSL.
Note: The workaround was to wrap the call in a check to see that row_groups was not empty!
changed the title [-]ParquetFile.iter_batches errors when row_groups is [][/-][+][Python][Parquet] ParquetFile.iter_batches errors when row_groups is [][/+]on Jan 25, 2025
Activity
kou commentedon Jan 24, 2025
#45339 may be the same problem.
Bill-Johnson-Seequent commentedon Jan 24, 2025
Agreed - looks like it's likely the same underlying cause. Happy to retest this case when 19.0.1 comes out 😄
raulcd commentedon Jan 24, 2025
Thanks for opening it @Bill-Johnson-Seequent
I am closing this as duplicate to have a single issue to track that.
[-]ParquetFile.iter_batches errors when row_groups is [][/-][+][Python][Parquet] ParquetFile.iter_batches errors when row_groups is [][/+]