kevinjqliu commented on code in PR #1539:
URL: https://github.com/apache/iceberg-python/pull/1539#discussion_r1922786157


##########
pyiceberg/partitioning.py:
##########
@@ -413,7 +414,9 @@ def partition_record_value(partition_field: PartitionField, 
value: Any, schema:
     the final partition record value.
     """
     iceberg_type = 
schema.find_field(name_or_id=partition_field.source_id).field_type
-    iceberg_typed_value = _to_partition_representation(iceberg_type, value)
+    if not isinstance(value, int):
+        # When adding files, it can be that we still need to convert from 
logical types to physical types
+        iceberg_typed_value = _to_partition_representation(iceberg_type, value)

Review Comment:
   is this due to the fact that we already transform the partition key value 
   ```
   
partition.transform.pyarrow_transform(source_field.field_type)(arrow_table[source_field.name])
   ```
   and this expects the untransformed value?
   
   if thats the case, can we just omit the transformation before the group_by? 



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

Reply via email to