HonahX opened a new pull request, #544: URL: https://github.com/apache/iceberg-python/pull/544
When working on https://github.com/apache/iceberg-python/pull/498, I noticed that `new_table_metadata` cannot correctly initialize `partition_specs` and `sort_oders` fields for V1 Metadata. For example: ```python schema = ... partition_spec = PartitionSpec( PartitionField(source_id=22, field_id=1022, transform=IdentityTransform(), name="bar"), spec_id=10 ) sort_order = SortOrder( SortField(source_id=10, transform=IdentityTransform(), direction=SortDirection.ASC, null_order=NullOrder.NULLS_LAST), order_id=10, ) actual = new_table_metadata( schema=schema, partition_spec=partition_spec, sort_order=sort_order, location="s3://some_v1_location/", properties={'format-version': "1"}, ) -------- print(actual.partition_specs) --- output --- [PartitionSpec(spec_id=0)] -------- print(actual.sort_orders) --- output --- [SortOrder(order_id=0)] ``` We may update the validators to consider both the field name and its alias. (ex "sort_orders" and "sort-orders") so that the validators won't override any initialized fields. cc: @Fokko @amogh-jahagirdar -- 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