lawofcycles commented on code in PR #3320:
URL: https://github.com/apache/iceberg-python/pull/3320#discussion_r3605688324


##########
pyiceberg/table/update/snapshot.py:
##########
@@ -132,8 +172,11 @@ def __init__(
         self._parent_snapshot_id = (
             snapshot.snapshot_id if (snapshot := 
self._transaction.table_metadata.snapshot_by_name(self._target_branch)) else 
None
         )
+        self._starting_snapshot_id = self._parent_snapshot_id
         self._predicate = AlwaysFalse()
         self._case_sensitive = True
+        self._commit_window = None
+        self._isolation_level_property: str = 
TableProperties.WRITE_DELETE_ISOLATION_LEVEL

Review Comment:
   Added `TableMetadata.isolation_level(operation)` and dropped the 
`_isolation_level_property` field. The producer just carries the operation now, 
and `_validate_concurrency` resolves the level from the metadata, so the lookup 
lives in one place and still picks up refreshed properties on retry.
   
   I based it on the logical operation (delete vs update) rather than the 
snapshot operation, to match Java. 
[`SparkRowLevelOperationBuilder.isolationLevel(properties, 
command)`](https://github.com/apache/iceberg/blob/4b4eb38cf6dda7b43faeb40eb00aa5db424d2ecb/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkRowLevelOperationBuilder.java#L95-L113)
 picks the property from the SQL command and applies it to the whole operation, 
including copy on write, so a copy on write delete stays on 
write.delete.isolation-level. Going by the snapshot operation would push the 
rewrite part of a delete onto write.update, which diverges.
   
   The tradeoff is that a small operation marker still travels with the 
producer. 



-- 
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