rutb327 commented on code in PR #2305:
URL: https://github.com/apache/iceberg-python/pull/2305#discussion_r2283283747
##########
pyiceberg/table/update/schema.py:
##########
@@ -658,6 +658,14 @@ def _apply(self) -> Schema:
# Check the field-ids
new_schema = Schema(*struct.fields)
+ if self._transaction is not None:
+ from pyiceberg.partitioning import validate_partition_name
+
+ for spec in self._transaction.table_metadata.partition_specs:
+ for partition_field in spec.fields:
+ validate_partition_name(
+ partition_field.name, partition_field.transform,
partition_field.source_id, new_schema
+ )
Review Comment:
Some tests show that transaction can be None in some cases, (after removing
the check, tests from test_schema.py are failing). They use:
`UpdateSchema(transaction=None, schema=Schema())`
[https://github.com/rutb327/iceberg-python/blob/24b12ddd8fdab4a62650786a2c3cdd56a53f8719/tests/test_schema.py#L933](url)
--
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]