Fokko commented on code in PR #1539: URL: https://github.com/apache/iceberg-python/pull/1539#discussion_r1922764937
########## pyiceberg/partitioning.py: ########## @@ -425,8 +426,13 @@ def _to_partition_representation(type: IcebergType, value: Any) -> Any: @_to_partition_representation.register(TimestampType) @_to_partition_representation.register(TimestamptzType) -def _(type: IcebergType, value: Optional[datetime]) -> Optional[int]: - return datetime_to_micros(value) if value is not None else None +def _(type: IcebergType, value: Optional[Union[datetime, int]]) -> Optional[int]: + if value is None: + return None + elif isinstance(value, int): + return value Review Comment: I'm not sure, I think we get the physical type instead of the logical type. Let me dig a bit further -- 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