rdblue commented on code in PR #4908:
URL: https://github.com/apache/iceberg/pull/4908#discussion_r885105459


##########
python/src/iceberg/utils/datetime.py:
##########
@@ -63,3 +65,27 @@ def timestamptz_to_micros(timestamptz_str: str) -> int:
     if ISO_TIMESTAMPTZ.fullmatch(timestamptz_str):
         return datetime_to_micros(datetime.fromisoformat(timestamptz_str))
     raise ValueError(f"Invalid timestamp with zone: {timestamptz_str} (must be 
ISO-8601)")
+
+
+def to_human_day(day_ordinal: int) -> str:
+    """Converts a DateType value to human string"""
+    to_time = EPOCH_TIMESTAMP + timedelta(days=day_ordinal)
+    return "{0:0=4d}-{1:0=2d}-{2:0=2d}".format(to_time.year, to_time.month, 
to_time.day)
+
+
+def to_human_time(micros_from_midnight: int) -> str:
+    """Converts a TimeType value to human string"""
+    to_day = EPOCH_TIMESTAMP + timedelta(microseconds=micros_from_midnight)
+    return f"{to_day.time()}"

Review Comment:
   I think this should also use `.isoformat()` after constructing a time.



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