Skip to content

GH-53500: Guard Parquet metadata equality against None - #53974

Closed
1932819331hy-debug wants to merge 4 commits into
apache:mainfrom
1932819331hy-debug:fix-parquet-metadata-none-equality
Closed

1932819331hy-debug wants to merge 4 commits into
apache:mainfrom
1932819331hy-debug:fix-parquet-metadata-none-equality

Conversation

@1932819331hy-debug

@1932819331hy-debug 1932819331hy-debug commented Oct 16, 2026 •

Copy link
Copy Markdown

Rationale for this change

Several Parquet metadata wrappers’ typed equals() methods can dereference None. Guard these arguments consistently with FileMetaData.equals() so explicit calls raise TypeError and comparisons with None are safe.

What changes are included in this PR?

  • Reject None in Statistics, ColumnChunkMetaData, RowGroupMetaData, ParquetSchema, and ColumnSchema equals() methods.
  • Add a regression test covering the five affected wrappers and FileMetaData.

Are these changes tested?

A regression test covers explicit equals(None) calls and != None comparisons. Tests were not run locally; GitHub CI will validate the Cython build and test.

Are there any user-facing changes?

Invalid equals(None) calls now raise TypeError instead of risking a process crash. Equality comparisons with None remain safe.

Was AI used for this PR?

PR code and description written by:

  • AI

Reviewed before submission by:

  • AI

Closes #53500

@jorisvandenbossche

Copy link
Copy Markdown
Member

Fully automated PRs are not welcome, see https://arrow.apache.org/docs/developers/overview.html#ai-generated-code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python][Parquet] Comparing metadata or schemas with None can crash Python

2 participants