You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Mola-maker (via GitHub)" <gi...@apache.org> on 2026/10/13 01:50:00 UTC
[I] [Python][Parquet] Comparing metadata or schemas with None can crash Python [arrow]
Mola-maker opened a new issue, #53500:
URL: https://github.com/apache/arrow/issues/53500
### Describe the bug
Parquet metadata and schema equality can terminate the Python interpreter when the other operand is `None`. For example, checking `metadata.row_group(0).column(0).statistics == None` causes SIGSEGV instead of returning `False`.
The `equals()` methods accept a typed Cython object without rejecting `None`, then access its native pointer. `FileMetaData.equals()` already uses `other not None`; the other five metadata/schema classes do not.
### Reproducer
Run in an isolated Python process:
```python
import pyarrow as pa
import pyarrow.parquet as pq
sink = pa.BufferOutputStream()
pq.write_table(pa.table({"value": [1, 2, 3]}), sink)
metadata = pq.read_metadata(pa.BufferReader(sink.getvalue()))
statistics = metadata.row_group(0).column(0).statistics
print(statistics == None) # process exits with SIGSEGV
```
The same result occurs with `.equals(None)`, row-group metadata, column-chunk metadata, and column schemas. On Arch Linux / CPython 3.14.8, `ParquetSchema` comparison also crashes. On Ubuntu / CPython 3.12.14 it happens to return `False`. This was reproduced with PyArrow 26.0.0 and with the current main `_parquet` extension built from source at `9b34c4a6a8856212b885f6a1e934795af04f3192` against the matching 26.0.0 SDK.
Expected: normal equality with `None` returns `False`; explicit `.equals(None)` rejects the invalid argument with `TypeError`, consistently with `FileMetaData`.
### Existing work checked
Open PRs #51161 and #51163 change other Parquet entry points (constructors, sorting, binary types). Their current patches do not change these five `equals()` methods. Searches for metadata/schema/statistics comparison and None-related open PRs found no overlapping fix.
### Component(s)
Python, Parquet
--
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-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python][Parquet] Comparing metadata or schemas with None can crash Python [arrow]
Posted by "nleerollergh (via GitHub)" <gi...@apache.org>.
nleerollergh commented on issue #53500:
URL: https://github.com/apache/arrow/issues/53500#issuecomment-6376504648
take
--
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
Re: [I] [Python][Parquet] Comparing metadata or schemas with None can crash Python [arrow]
Posted by "nleerollergh (via GitHub)" <gi...@apache.org>.
nleerollergh commented on issue #53500:
URL: https://github.com/apache/arrow/issues/53500#issuecomment-6448633089
Taking this issue btw!
--
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
Re: [I] [Python][Parquet] Comparing metadata or schemas with None can crash Python [arrow]
Posted by "nleerollergh (via GitHub)" <gi...@apache.org>.
nleerollergh commented on issue #53500:
URL: https://github.com/apache/arrow/issues/53500#issuecomment-6376572484
Hi @Mola-maker — I see the commits linked above. Are you still planning to open a PR for this? If not, I’d be happy to take it over
--
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