chinmay-bhat commented on code in PR #728:
URL: https://github.com/apache/iceberg-python/pull/728#discussion_r1597811301


##########
pyiceberg/table/__init__.py:
##########
@@ -340,6 +340,34 @@ def set_properties(self, properties: Properties = 
EMPTY_DICT, **kwargs: Any) ->
         updates = properties or kwargs
         return self._apply((SetPropertiesUpdate(updates=updates),))
 
+    def set_ref_snapshot(
+        self,
+        snapshot_id: int,
+        parent_snapshot_id: Optional[int],
+        ref_name: str,
+        type: str,
+        max_age_ref_ms: Optional[int] = None,
+        max_snapshot_age_ms: Optional[int] = None,
+        min_snapshots_to_keep: Optional[int] = None,
+    ) -> Transaction:
+        """Update a ref to a snapshot.
+
+        Returns:
+            The transaction with the set-snapshot-ref staged
+        """
+        updates = SetSnapshotRefUpdate(
+            snapshot_id=snapshot_id,
+            parent_snapshot_id=parent_snapshot_id,
+            ref_name=ref_name,

Review Comment:
   removed!



##########
pyiceberg/table/__init__.py:
##########
@@ -340,6 +340,34 @@ def set_properties(self, properties: Properties = 
EMPTY_DICT, **kwargs: Any) ->
         updates = properties or kwargs
         return self._apply((SetPropertiesUpdate(updates=updates),))
 
+    def set_ref_snapshot(
+        self,
+        snapshot_id: int,
+        parent_snapshot_id: Optional[int],
+        ref_name: str,
+        type: str,
+        max_age_ref_ms: Optional[int] = None,
+        max_snapshot_age_ms: Optional[int] = None,
+        min_snapshots_to_keep: Optional[int] = None,
+    ) -> Transaction:
+        """Update a ref to a snapshot.
+
+        Returns:
+            The transaction with the set-snapshot-ref staged
+        """
+        updates = SetSnapshotRefUpdate(
+            snapshot_id=snapshot_id,
+            parent_snapshot_id=parent_snapshot_id,
+            ref_name=ref_name,
+            type=type,
+            max_age_ref_ms=max_age_ref_ms,
+            max_snapshot_age_ms=max_snapshot_age_ms,
+            min_snapshots_to_keep=min_snapshots_to_keep,
+        )
+
+        requirements = AssertRefSnapshotId(snapshot_id=parent_snapshot_id, 
ref="main")

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to