You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "TomAugspurger (via GitHub)" <gi...@apache.org> on 2026/10/09 16:17:28 UTC
Re: [PR] MINOR: [Python][Parquet] Clarify code around restoring pandas metadata in ParquetDataset.read() [arrow]
TomAugspurger commented on PR #51151:
URL: https://github.com/apache/arrow/pull/51151#issuecomment-6084791916
FYI @jorisvandenbossche, this did cause a behavior change in pandas when reading zero columns. With pyarrow==25.x, that returned a `(0, 0)` shape dataframe. With pyarrow==26, it returns a `(nrows, 0)` shape dataframe
```python
import io
import pandas as pd
df = pd.DataFrame({"a": [1, 2, 3]})
b = io.BytesIO()
df.to_parquet(b)
empty = pd.read_parquet(b, columns=[])
print(empty.shape) # (0, 0) for pyarrow=25.x; (3, 0) for pyarrow=26.x
```
I think that `(nrows, 0)` is the shape I'd expect, but leaving a note here in case anyone else stumbles across this (xref https://github.com/NVIDIA/cudf/pull/24520).
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org