Ankitraj-builds commented on code in PR #4160:
URL: https://github.com/apache/iceberg-python/pull/4160#discussion_r4459880209


##########
pyiceberg/table/update/__init__.py:
##########
@@ -372,6 +372,7 @@ def _(update: RemovePropertiesUpdate, base_metadata: 
TableMetadata, context: _Ta
 
 @_apply_table_update.register(AddSchemaUpdate)
 def _(update: AddSchemaUpdate, base_metadata: TableMetadata, context: 
_TableMetadataUpdateContext) -> TableMetadata:
+    
update.schema_.check_format_version_compatibility(base_metadata.format_version)

Review Comment:
   Done @rambleraptor, added the check to UpdateSchema._commit as well, so it 
fails before the updates are sent. I put it inside the “schema changed” branch 
so a commit with no schema change still works. Also added 
test_update_schema_commit_checks_format_version, which calls _commit() 
directly. Thanks for the review!



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