gabeiglio commented on code in PR #2367: URL: https://github.com/apache/iceberg-python/pull/2367#discussion_r2345613573
########## pyiceberg/partitioning.py: ########## @@ -222,11 +223,14 @@ def partition_type(self, schema: Schema) -> StructType: :return: A StructType that represents the PartitionSpec, with a NestedField for each PartitionField. """ nested_fields = [] + schema_ids = index_by_id(schema) for field in self.fields: - source_type = schema.find_type(field.source_id) - result_type = field.transform.result_type(source_type) - required = schema.find_field(field.source_id).required - nested_fields.append(NestedField(field.field_id, field.name, result_type, required=required)) + if field.source_id in schema_ids: + source_field = schema.find_field(field.source_id) + result_type = field.transform.result_type(source_field.field_type) + nested_fields.append(NestedField(field.field_id, field.name, result_type, required=source_field.required)) + else: Review Comment: @Fokko gentle pin as this might gone off radar :) -- 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