Skip to content

GH-51446: [CI][Python] Fix test collection errors when Parquet encryption is unavailable - #51457

Merged
raulcd merged 1 commit into
apache:mainfrom
adamreeve:kms-test-fix
Sep 22, 2026
Merged

raulcd merged 1 commit into
apache:mainfrom
adamreeve:kms-test-fix

Conversation

@adamreeve

@adamreeve adamreeve commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Fixes test collection failing in nightly builds that don't have Parquet encryption enabled.

What changes are included in this PR?

Don't reference InMemoryKmsClient in function signatures, it's not defined if pyarrow.parquet.encryption can't be imported.

Are these changes tested?

Yes, I reproduced the crash collecting tests without encryption enabled and verified this is fixed, and also verified the tests still work with encryption enabled.

Are there any user-facing changes?

No

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

Copilot AI lite review requested due to automatic review settings September 22, 2026 10:35
@github-actions github-actions Bot added the awaiting review Awaiting review label Sep 22, 2026
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #51446 has been automatically assigned in GitHub to PR creator.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Fixes test collection failures when Parquet encryption is unavailable.

Changes:

  • Defers InMemoryKmsClient resolution until the factory is used.
  • Preserves encrypted-test behavior.
File Description
python/​pyarrow/​tests/​parquet/​test_encryption.py Prevents NameError during test collection without encryption support.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@raulcd

raulcd commented Sep 22, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit example-python-minimal-build-fedora-conda example-python-minimal-build-ubuntu-venv test-conda-python-3.12-pandas-latest-numpy-latest test-conda-python-3.13-pandas-latest-numpy-2.1.3 test-conda-python-3.13-pandas-latest-numpy-latest

@github-actions

Copy link
Copy Markdown

Revision: c30ee4b

Submitted crossbow builds: ursacomputing/crossbow @ actions-fc4c60f35b

Task Status
example-python-minimal-build-fedora-conda GitHub Actions
example-python-minimal-build-ubuntu-venv GitHub Actions
test-conda-python-3.12-pandas-latest-numpy-latest GitHub Actions
test-conda-python-3.13-pandas-latest-numpy-2.1.3 GitHub Actions
test-conda-python-3.13-pandas-latest-numpy-latest GitHub Actions

@raulcd raulcd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adamreeve

@raulcd
raulcd merged commit ac006a4 into apache:main Sep 22, 2026
40 checks passed
@raulcd raulcd removed the awaiting review Awaiting review label Sep 22, 2026
@github-actions github-actions Bot added the awaiting merge Awaiting merge label Sep 22, 2026
@adamreeve
adamreeve deleted the kms-test-fix branch September 22, 2026 23:08
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.

3 participants