Skip to content

Commit 4ef55d3

Browse files
authored
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
1 parent 1b69a25 commit 4ef55d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyiceberg/table/update/snapshot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ def create_tag(self, snapshot_id: int, tag_name: str, max_ref_age_ms: int | None
880880
update, requirement = self._transaction._set_ref_snapshot(
881881
snapshot_id=snapshot_id,
882882
ref_name=tag_name,
883-
type="tag",
883+
type=SnapshotRefType.TAG,
884884
max_ref_age_ms=max_ref_age_ms,
885885
)
886886
self._updates += update
@@ -921,7 +921,7 @@ def create_branch(
921921
update, requirement = self._transaction._set_ref_snapshot(
922922
snapshot_id=snapshot_id,
923923
ref_name=branch_name,
924-
type="branch",
924+
type=SnapshotRefType.BRANCH,
925925
max_ref_age_ms=max_ref_age_ms,
926926
max_snapshot_age_ms=max_snapshot_age_ms,
927927
min_snapshots_to_keep=min_snapshots_to_keep,

0 commit comments

Comments
 (0)