Fokko commented on code in PR #555:
URL: https://github.com/apache/iceberg-python/pull/555#discussion_r1552302617
##########
pyiceberg/manifest.py:
##########
@@ -283,31 +277,12 @@ def __repr__(self) -> str:
}
-@singledispatch
-def partition_field_to_data_file_partition_field(partition_field_type:
IcebergType) -> PrimitiveType:
- raise TypeError(f"Unsupported partition field type:
{partition_field_type}")
-
-
-@partition_field_to_data_file_partition_field.register(LongType)
-@partition_field_to_data_file_partition_field.register(DateType)
-@partition_field_to_data_file_partition_field.register(TimeType)
-@partition_field_to_data_file_partition_field.register(TimestampType)
-@partition_field_to_data_file_partition_field.register(TimestamptzType)
-def _(partition_field_type: PrimitiveType) -> IntegerType:
- return IntegerType()
-
-
-@partition_field_to_data_file_partition_field.register(PrimitiveType)
-def _(partition_field_type: PrimitiveType) -> PrimitiveType:
- return partition_field_type
-
-
-def data_file_with_partition(partition_type: StructType, format_version:
TableVersion) -> StructType:
+def data_file_with_partition(partition_type: StructType, format_version:
Literal[1, 2]) -> StructType:
Review Comment:
Nit:
```suggestion
def data_file_with_partition(partition_type: StructType, format_version:
TableVersion) -> StructType:
```
##########
pyiceberg/manifest.py:
##########
@@ -289,10 +286,7 @@ def
partition_field_to_data_file_partition_field(partition_field_type: IcebergTy
@partition_field_to_data_file_partition_field.register(LongType)
-@partition_field_to_data_file_partition_field.register(DateType)
Review Comment:
Beautiful, thanks 👍
--
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]