Fokko commented on code in PR #2367:
URL: https://github.com/apache/iceberg-python/pull/2367#discussion_r2575589843


##########
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:
   Sorry, I think I misunderstood the question, but nothing is being dropped 
here, so that all looks good.



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