Fokko commented on code in PR #1772:
URL: https://github.com/apache/iceberg-python/pull/1772#discussion_r2050541351


##########
pyiceberg/table/update/snapshot.py:
##########
@@ -279,6 +296,30 @@ def _commit(self) -> UpdatesAndRequirements:
             
(AssertRefSnapshotId(snapshot_id=self._transaction.table_metadata.current_snapshot_id,
 ref="main"),),
         )
 
+    def _validate(self, starting_snapshot: Snapshot, current_snapshot: 
Snapshot) -> None:
+        # Define allowed operations for each type of operation
+        allowed_operations = {
+            Operation.APPEND: {Operation.APPEND, Operation.REPLACE, 
Operation.OVERWRITE, Operation.DELETE},
+            Operation.REPLACE: {Operation.APPEND},

Review Comment:
   Thanks @sungwy for jumping in here, and creating the issues 🙌 
   
   And indeed, based on if we do snapshot or serializable isolation, we should 
allow for new data (or not)



##########
pyiceberg/table/update/snapshot.py:
##########
@@ -279,6 +296,30 @@ def _commit(self) -> UpdatesAndRequirements:
             
(AssertRefSnapshotId(snapshot_id=self._transaction.table_metadata.current_snapshot_id,
 ref="main"),),
         )
 
+    def _validate(self, starting_snapshot: Snapshot, current_snapshot: 
Snapshot) -> None:
+        # Define allowed operations for each type of operation
+        allowed_operations = {
+            Operation.APPEND: {Operation.APPEND, Operation.REPLACE, 
Operation.OVERWRITE, Operation.DELETE},
+            Operation.REPLACE: {Operation.APPEND},

Review Comment:
   Thanks @sungwy for jumping in here, and creating the issues 🙌 
   
   And indeed, based on if we do snapshot or serializable isolation, we should 
allow for new data (or not).



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to