zhengruifeng commented on code in PR #42920:
URL: https://github.com/apache/spark/pull/42920#discussion_r1325319963


##########
python/pyspark/pandas/typedef/typehints.py:
##########
@@ -293,7 +293,9 @@ def spark_type_to_pandas_dtype(
         ),
     ):
         return np.dtype("object")
-    elif isinstance(spark_type, types.TimestampType):
+    elif isinstance(spark_type, types.DayTimeIntervalType):
+        return np.dtype("timedelta64[ns]")
+    elif isinstance(spark_type, (types.TimestampType, types.TimestampNTZType)):
         return np.dtype("datetime64[ns]")
     else:
         return np.dtype(to_arrow_type(spark_type).to_pandas_dtype())

Review Comment:
   the behavior of `to_arrow_type(spark_type).to_pandas_dtype()` changed, e.g.:
   
    `to_arrow_type(DayTimeIntervalType)` -> `pa.timestamp("us", tz="UTC")` -> 
`datetime64[us, UTC]` in 13.0.0, but `datetime64[ns, UTC]` in 12.0.1



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