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


##########
pyiceberg/table/__init__.py:
##########
@@ -255,12 +254,15 @@ def __init__(self, table: Table, autocommit: bool = 
False):
             table: The table that will be altered.
             autocommit: Option to automatically commit the changes when they 
are staged.
         """
-        self.table_metadata = table.metadata
         self._table = table
         self._autocommit = autocommit
         self._updates = ()
         self._requirements = ()
 
+    @property
+    def table_metadata(self) -> TableMetadata:
+        return update_table_metadata(self._table.metadata, self._updates)

Review Comment:
   Yes, your assessment is correct. The main issue that it tackles is that we 
remove the `Metadata` state on the Transaction layer. When we start 
implementing optimistic concurrency, before applying the commit, we could 
refresh the underlying table when we do a retry.
   
   I think the code will have pretty decent performance since it will use 
Pydantic under the hood which delegates everything to their Rust layer, and 
also the `singledispatch` logic is also pretty performant.



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