Can't get column from ParquetFile schema using PyArrow
Open
Component: Python
Type: bug
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
### Describe the bug, including details regarding any error messages, version, and platform.
Consider this code
```python
import pandas as pd
from pyarrow.parquet import ParquetFile
df = pd.DataFrame({"a": [1], "b": [2]})
df.to_parquet('/tmp/test.parquet')
f = ParquetFile('/tmp/test.parquet')
f.schema.column('a')
```
Using Python 3.8, pyarrow 11.0.0 and pandas 1.5.3, I get the following error from the last line:
```
Traceback (most recent call last):
File "", line 1, in
File "pyarrow/_parquet.pyx", line 907, in pyarrow._parquet.ParquetSchema.column
TypeError: '<' not supported between instances of 'str' and 'int'
```
### Component(s)
Python
Contributor guide
Assessment
This issue has not been assessed yet.