Repository navigation
feat(encryption): [7/N] Add encryption key updates - #4148
Merged
Merged
Conversation
xanderbailey
commented
Oct 24, 2026
| snapshot_id: int = Field(alias="snapshot-id") | ||
|
|
||
|
|
||
| class AddEncryptionKeyUpdate(IcebergBaseModel): |
Contributor
Author
There was a problem hiding this comment.
Matches Rust's TableUpdate::AddEncryptionKey.
Contributor
There was a problem hiding this comment.
| encryption_key: EncryptedKey = Field(alias="encryption-key") | ||
|
|
||
|
|
||
| class RemoveEncryptionKeyUpdate(IcebergBaseModel): |
Contributor
Author
There was a problem hiding this comment.
Matches Rust's TableUpdate::RemoveEncryptionKey.
Contributor
There was a problem hiding this comment.
| if not isinstance(base_metadata, TableMetadataV3): | ||
| raise ValueError(f"Encryption keys are not supported in format version {base_metadata.format_version}") | ||
|
|
||
| if any(key.key_id == update.encryption_key.key_id for key in base_metadata.encryption_keys): |
Contributor
Author
There was a problem hiding this comment.
Existing key id is a no-op, as in Rust's add_encryption_key.
| raise ValueError(f"Encryption keys are not supported in format version {base_metadata.format_version}") | ||
|
|
||
| encryption_keys = [key for key in base_metadata.encryption_keys if key.key_id != update.key_id] | ||
| if len(encryption_keys) == len(base_metadata.encryption_keys): |
Contributor
Author
There was a problem hiding this comment.
Removing a missing key is a no-op, as in Rust's remove_encryption_key.
kevinjqliu
approved these changes
Oct 24, 2026
kevinjqliu
reviewed
Oct 24, 2026
Comment on lines
+703
to
+704
| if not isinstance(base_metadata, TableMetadataV3): | ||
| raise ValueError(f"Encryption keys are not supported in format version {base_metadata.format_version}") |
3 tasks
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.
Working towards #3222
Rationale for this change
We need to be able to send add / remove key changed with the update table request
Are these changes tested?
Are there any user-facing changes?