Skip to content

Conversation

@pfparsons
Copy link

@pfparsons pfparsons commented Oct 30, 2025

Rationale for this change

Enables external key material and rotation for individual parquet files in PyArrow. This change does not address any parquet dataset encryption functionality. (though I would be happy to keep going with any work required for other applications of external store including the dataset API once I get some feedback on this PR)

What changes are included in this PR?

This PR enables external key material for parquet encryption from PyArrow:
Optional parquet_file_path and FileSystem paramters to CryptoFactory - mirroring the interface for CryptoFactory in C++

  1. Exposes the rotate_master_keys method of CryptoFactory

  2. Adds Cython classes for FileKeyMaterialStore, FileSystemKeyMaterialStore, and KeyMaterial - but does not expose these from PyArrow encryption. I included these changes only so that a unit test may verify an external store without leaking the implementation details for the store into the test.

Are these changes tested?

Yes - I've modified an existing test (previously marked pytest.xfail) to do a basic read write test and verify creation of the external key material store.

I would like to get some feedback as to whether this change is welcome and headed in the right direction before going any further.

Are there any user-facing changes?

This change enables users to optionally supply a parquet file path and FileSystem to CryptoFactory methods that provide en/decryption_properties.

@github-actions
Copy link

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

See also:

@pfparsons pfparsons changed the title First pass at implementing external key material features in python GH-31869: [Python][Parquet] First pass at implementing external key material features in python Oct 30, 2025
@github-actions
Copy link

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

1 similar comment
@github-actions
Copy link

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

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

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

@pfparsons
Copy link
Author

Hi @raulcd would you mind taking a look at this?

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.

1 participant