smaheshwar-pltr commented on code in PR #4522:
URL: https://github.com/apache/iceberg-python/pull/4522#discussion_r4733677442
##########
pyiceberg/table/update/__init__.py:
##########
@@ -373,12 +373,13 @@ def _(update: SetPropertiesUpdate, base_metadata:
TableMetadata, context: _Table
@_apply_table_update.register(RemovePropertiesUpdate)
def _(update: RemovePropertiesUpdate, base_metadata: TableMetadata, context:
_TableMetadataUpdateContext) -> TableMetadata:
- if len(update.removals) == 0:
- return base_metadata
-
properties = dict(base_metadata.properties)
for key in update.removals:
- properties.pop(key)
+ # Ignore keys that aren't set, since a concurrent commit may have
removed them
+ properties.pop(key, None)
+
+ if len(properties) == len(base_metadata.properties):
+ return base_metadata
Review Comment:
(This is similar to how we handle e.g. `RemoveSnapshotRefUpdate` in this
file and the check we had before here - it prevents catalogs writing
unnecessary metadata when nothing has changed)
--
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]