cloud-fan commented on code in PR #39239:
URL: https://github.com/apache/spark/pull/39239#discussion_r1058786637
##########
python/pyspark/sql/types.py:
##########
@@ -276,7 +276,18 @@ def toInternal(self, dt: datetime.datetime) -> int:
def fromInternal(self, ts: int) -> datetime.datetime:
if ts is not None:
# using int to avoid precision loss in float
- return datetime.datetime.fromtimestamp(ts //
1000000).replace(microsecond=ts % 1000000)
+ return (
+ datetime.datetime
Review Comment:
We need domain experts to introduce the semantic of python datetime.
For the timestamp (ltz) type, the semantic is: it's a physical time point,
and can map to different wall clock time with different local timezone. In
Java, the best match is `Instant`, but I'm not sure about python `datetime`
though.
--
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]