rdblue commented on code in PR #5627: URL: https://github.com/apache/iceberg/pull/5627#discussion_r954176689
########## python/pyiceberg/table/partitioning.py: ########## @@ -157,3 +159,20 @@ def compatible_with(self, other: "PartitionSpec") -> bool: UNPARTITIONED_PARTITION_SPEC = PartitionSpec(spec_id=0) + + +def assign_fresh_partition_spec_ids(spec: PartitionSpec, schema: Schema) -> PartitionSpec: + partition_fields = [] + for pos, field in enumerate(spec.fields): + schema_field = schema.find_field(field.name) Review Comment: This is the partition field name, not a schema field name. The schema field must be looked up by `source_id`. This method needs both the original schema and the fresh schema. The original schema is used to get field names and then the fresh schema is used to look up the new source ID. -- 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