HonahX commented on code in PR #498: URL: https://github.com/apache/iceberg-python/pull/498#discussion_r1550918541
########## pyiceberg/table/__init__.py: ########## @@ -760,7 +852,10 @@ def update_table_metadata(base_metadata: TableMetadata, updates: Tuple[TableUpda for update in updates: new_metadata = _apply_table_update(update, new_metadata, context) - return new_metadata.model_copy(deep=True) + if enforce_validation: + return TableMetadataUtil.parse_obj(new_metadata.model_dump()) Review Comment: 👍 Since for create-table-transaction commit, we are generating the entire metadata model via a chain of `model_copy` without any validation, I feel it safer to trigger a validation on the model before return :D -- 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