Mola-maker opened a new pull request, #53512: URL: https://github.com/apache/arrow/pull/53512
### Rationale for this change Comparing Parquet row-group metadata, column-chunk metadata, statistics, or column schemas with `None` can terminate Python with SIGSEGV. On CPython 3.14, Parquet schema comparison also crashes. Their typed `equals()` arguments accept `None` before accessing native pointers; `FileMetaData.equals()` already rejects it. Closes #53500. Open PRs #51161 and #51163 were checked: their Parquet changes cover other entry points, with no overlap in these equality methods. ### What changes are included in this PR? Add `other not None` to the five remaining metadata/schema `equals()` signatures. The existing `__eq__` handlers then return `NotImplemented` for `None`, allowing normal Python comparison behavior. Extend the existing equality regression across all six metadata/schema types, including valid comparisons, both operand orders, inequality and explicit `.equals(None)` errors. ### Are these changes tested? - Actual source-compiled `_parquet` extensions on Ubuntu/CPython 3.12.14 and Arch Linux/CPython 3.14.8, using Cython 3.3.0 and g++ against the unchanged official PyArrow 26.0.0 C++ SDK. Available Cython declarations matched the source byte for byte. - Before: eight SIGSEGV results on Ubuntu, ten on Arch, in independent processes after real Parquet write/read. After: zero on both. - `test_metadata.py --enable-s3`: **46 passed, 1 skipped on each runtime**. The skip is the existing large-memory test group disabled by default. S3 actually ran with Arrow's checksum-verified MinIO, compatible boto3/s3fs dependencies, and official Parquet fixtures at `56653c437c8092f704a092d0d1d4e600124cd49f`. - Isolated environments pass `pip check`; independent read-only AI code review found no blocking issue. [Immutable build logs, dependency versions, reproducer and test evidence](https://github.com/Mola-maker/arrow/tree/5e0c6793a71abcc370313f037ddf305b496cd64f). Unmodified native full-screen captures from the running Arch/Omarchy KVM guest:   ### Are there any user-facing changes? Equality with `None` safely returns `False`, and inequality returns `True`. Explicit `.equals(None)` raises `TypeError`, consistently with `FileMetaData`. Valid-object comparisons are unchanged. ### Was AI used for this PR? AI performed the investigation and wrote the patch, regression tests and this description. Another AI reviewer inspected the source and generated C++ before submission. The build, dependency installation, process-exit checks and native captures above were executed in the stated environments. **PR code and description written by:** - [ ] Human - [x] AI **Reviewed before submission by:** - [ ] Human - [x] AI - [ ] Not reviewed -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
