JingsongLi commented on code in PR #8319:
URL: https://github.com/apache/paimon/pull/8319#discussion_r3459354865
##########
paimon-python/pypaimon/catalog/filesystem_catalog.py:
##########
@@ -453,16 +451,24 @@ def get_tag(
tag = table.tag_manager().get(tag_name)
if tag is None:
raise TagNotExistException(tag_name)
- # tag_create_time / tag_time_retained are not tracked on the
- # filesystem side yet — the Python Tag dataclass inherits only
- # Snapshot fields. Returning ``None`` for both keeps the response
- # shape compatible with the Java contract while making the gap
- # visible to callers.
+ # Surface tag_create_time as epoch millis and tag_time_retained as an
+ # ISO-8601 duration string (types match the Java REST GetTagResponse
+ # Long / String). The millis treat the timezone-less create-time as UTC
+ # (consistent with the ``$tags`` system table); note Java's REST server
+ # converts using the system default zone, so the numeric value can
+ # differ on non-UTC hosts. Both are None for tags created without a
+ # retention (plain-snapshot tag files).
return GetTagResponse(
tag_name=tag_name,
snapshot=tag.trim_to_snapshot(),
- tag_create_time=None,
- tag_time_retained=None,
+ tag_create_time=(
+ None if tag.tag_create_time is None
+ else local_datetime_to_millis(tag.tag_create_time)
Review Comment:
`GetTagResponse` is supposed to mirror the Java REST response, but this
conversion treats the tag `LocalDateTime` as UTC. The Java REST path converts
`tagCreateTime` with
`atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()`, and `TagManager`
creates the value with local `LocalDateTime.now()`. On non-UTC hosts, a
filesystem-catalog tag created at local noon will be reported as noon UTC here,
offset by the local timezone (for example +8h in Asia/Shanghai). Can we match
the Java REST conversion here, and add a non-UTC timezone test to lock it down?
--
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]