Repository navigation
test(parquet): pyarrow encryption interop tests - #1439
Open
EdwardShen125 wants to merge 1 commit into
Open
EdwardShen125 wants to merge 1 commit into
EdwardShen125 wants to merge 1 commit into
Conversation
zeroshade
requested changes
Nov 2, 2026
zeroshade
left a comment
Member
There was a problem hiding this comment.
Thanks, this is a useful harness. With pyarrow 26 installed, go test -race -run Pyarrow ./parquet/ passes: Go reads all four pyarrow-written configs, and pyarrow reads the Go-written file. Without pyarrow everything skips cleanly.
- CI: please include the one-line addition to
ci/scripts/cgo_python_test.shin this PR. That job is the only one with pyarrow installed, and without it these tests always skip in CI. TestPyarrowKmsWrittenConfigs: it only skips, so I'd leave it out and add it with the PKMT1 follow-up. #566 already tracks the gap.- Optional: once CI runs these, an env var in that job that turns the "pyarrow not available" skip into a failure would keep an image change from silently disabling them.
- Nit:
plainfooter_directwould also pass with an encrypted footer; asserting the footer is plaintext would make the case check what its name says.
Cross-language coverage for the direct-key encryption configs: read pyarrow-written files in Go (uniform GCM, AES-GCM-CTR, AAD prefix, plaintext footer) and have pyarrow read an arrow-go-written file. The helper script is embedded in the test binary and driven through python3; tests skip cleanly when python3 or pyarrow isn't installed. Part of apache#566
EdwardShen125
force-pushed
the
parquet-encryption-interop
branch
from
November 3, 2026 03:11
9082c75 to
39bd28a
Compare
EdwardShen125
requested review from
assignUser,
kou and
raulcd
as code owners
November 3, 2026 03:11
Author
|
All four done: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
#566 reports encryption and decryption failures between pyarrow and arrow-go. The direct-key half no longer reproduces on main: reading pyarrow-written files in Go works for uniform AES-GCM, AES-GCM-CTR, AAD prefix and plaintext footer, and pyarrow reads an arrow-go-written file. Checked against pyarrow 26; I suspect #596/#1390/#1412 fixed this but haven't bisected. Nothing tests these paths in either direction today, so it could regress unnoticed.
What still fails is KMS. pyarrow's
CryptoFactorywrites PKMT1 key material with a wrapped DEK, arrow-go has no parser or unwrapping for it, so footer decryption fails without a custom retriever. That gap stays tracked in #566; per review the skip-only KMS test was left out of this PR and belongs with the PKMT1 follow-up.What changes are included in this PR?
encryption_interop_pyarrow.pygenerates the encrypted files and reads a Go-written one; it is embedded in the test binary and run throughpython3.encryption_interop_pyarrow_test.goholds the tests. They skip whenpython3orpyarrowisn't installed, so the default test run is unchanged.plainfooter_directalso asserts the footer magic staysPAR1(an encrypted footer would end inPARE1) so the case checks what its name says.CI:
ci/scripts/cgo_python_test.sh, which runs in thedocker-cgo-pythonjob (the only one with pyarrow installed), now runsgo test -run Pyarrowon the package withPARQUET_TEST_REQUIRE_PYARROW=1, which turns the "pyarrow not available" skip into a failure so an image change can't silently disable the tests. Since the install is unpinned, the tests follow the current pyarrow release.Are these changes tested?
The tests are the change. Against pyarrow 26 locally: the four direct-key configs pass and pyarrow reads the Go-written file back correctly. Without python3 or pyarrow everything skips.
Are there any user-facing changes?
No, tests only.