This is an automated email from the ASF dual-hosted git repository.
kevinjqliu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
The following commit(s) were added to refs/heads/main by this push:
new 4ef55d32 chore: Use `SnapshotRefType` Enum instead of hard-coded
strings (#2880)
4ef55d32 is described below
commit 4ef55d320f883f9f7e75d83b24f84bfe931f10ae
Author: Jayce Slesar <[email protected]>
AuthorDate: Sun Jan 4 13:53:31 2026 -0500
chore: Use `SnapshotRefType` Enum instead of hard-coded strings (#2880)
# Rationale for this change
Use the enum instead of hard-coded strings!
Everywhere else that `"branch"` and `"tag"` are used seems to be in
tests so I think fine to leave those alone
## Are these changes tested?
No functional changes
## Are there any user-facing changes?
No
---
pyiceberg/table/update/snapshot.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyiceberg/table/update/snapshot.py
b/pyiceberg/table/update/snapshot.py
index e89cd45d..84298e08 100644
--- a/pyiceberg/table/update/snapshot.py
+++ b/pyiceberg/table/update/snapshot.py
@@ -880,7 +880,7 @@ class
ManageSnapshots(UpdateTableMetadata["ManageSnapshots"]):
update, requirement = self._transaction._set_ref_snapshot(
snapshot_id=snapshot_id,
ref_name=tag_name,
- type="tag",
+ type=SnapshotRefType.TAG,
max_ref_age_ms=max_ref_age_ms,
)
self._updates += update
@@ -921,7 +921,7 @@ class
ManageSnapshots(UpdateTableMetadata["ManageSnapshots"]):
update, requirement = self._transaction._set_ref_snapshot(
snapshot_id=snapshot_id,
ref_name=branch_name,
- type="branch",
+ type=SnapshotRefType.BRANCH,
max_ref_age_ms=max_ref_age_ms,
max_snapshot_age_ms=max_snapshot_age_ms,
min_snapshots_to_keep=min_snapshots_to_keep,