kz930 commented on code in PR #8704:
URL: https://github.com/apache/texera/pull/8704#discussion_r4364587721


##########
amber/src/main/python/core/models/schema/attribute_type.py:
##########
@@ -98,18 +98,18 @@ def _parse_bool(v):
 
 
 def _parse_timestamp(v):
+    # A TIMESTAMP reaches a worker as a wall clock with no zone, so a value
+    # parsed here holds none either and compares with a row's. An offset is
+    # moved to the machine's zone first, as the engine's DateParserUtils does.
     if _is_empty_value(v):
-        return datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc)
+        return datetime.datetime(1970, 1, 1)
 
     normalized_value = str(v)
     if normalized_value.endswith("Z"):
         normalized_value = normalized_value[:-1] + "+00:00"
     parsed_value = datetime.datetime.fromisoformat(normalized_value)
-    if (
-        parsed_value.tzinfo is None
-        or parsed_value.tzinfo.utcoffset(parsed_value) is None
-    ):
-        return parsed_value.replace(tzinfo=datetime.timezone.utc)
+    if parsed_value.utcoffset() is not None:
+        return parsed_value.astimezone().replace(tzinfo=None)
     return parsed_value
 

Review Comment:
   Thanks, confirmed. The parser now converts an offset through the machine's 
zone by name (TZ or /etc/localtime via zoneinfo), so it no longer calls 
localtime, and where no zone is named and localtime refuses a pre-1970 instant 
it takes the standard offset. The tzset tests now skip where tzset is missing, 
and a new case imitates the Windows refusal for your three inputs (a589a35ae).



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

Reply via email to