Fokko commented on code in PR #1598:
URL: https://github.com/apache/iceberg-python/pull/1598#discussion_r1939195894
##########
pyiceberg/table/update/__init__.py:
##########
@@ -466,6 +466,21 @@ def _(update: SetSnapshotRefUpdate, base_metadata:
TableMetadata, context: _Tabl
return base_metadata.model_copy(update=metadata_updates)
+@_apply_table_update.register(RemoveSnapshotRefUpdate)
+def _(update: RemoveSnapshotRefUpdate, base_metadata: TableMetadata, context:
_TableMetadataUpdateContext) -> TableMetadata:
+ if (existing_ref := base_metadata.refs.get(update.ref_name, None)) is None:
Review Comment:
I think this is a more Pythonic approach:
```suggestion
if update.ref_name not in base_metadata.refs:
```
--
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]