Skip to content

Commit c8b6530

Browse files
committed
Refactored the approach for initializing instance-level attributes
1 parent 4565968 commit c8b6530

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pyiceberg/table/update/snapshot.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -924,12 +924,15 @@ class ExpireSnapshots(UpdateTableMetadata["ExpireSnapshots"]):
924924
Pending changes are applied on commit.
925925
"""
926926

927+
_updates: Tuple[TableUpdate, ...]
928+
_requirements: Tuple[TableRequirement, ...]
929+
_snapshot_ids_to_expire: Set[int]
930+
927931
def __init__(self, transaction: Transaction) -> None:
928932
super().__init__(transaction)
929-
# Initialize instance-level attributes to avoid sharing state between instances
930-
self._snapshot_ids_to_expire: Set[int] = set()
931-
self._updates: Tuple[TableUpdate, ...] = ()
932-
self._requirements: Tuple[TableRequirement, ...] = ()
933+
self._updates = ()
934+
self._requirements = ()
935+
self._snapshot_ids_to_expire = set()
933936

934937
def _commit(self) -> UpdatesAndRequirements:
935938
"""

0 commit comments

Comments
 (0)