HyukjinKwon commented on code in PR #48159:
URL: https://github.com/apache/spark/pull/48159#discussion_r1766121985


##########
python/pyspark/sql/connect/expressions.py:
##########
@@ -489,7 +489,20 @@ def __repr__(self) -> str:
             ts = TimestampNTZType().fromInternal(self._value)
             if ts is not None and isinstance(ts, datetime.datetime):
                 return ts.strftime("%Y-%m-%d %H:%M:%S.%f")
-        # TODO(SPARK-49693): Refine the string representation of timedelta
+        elif isinstance(self._dataType, DayTimeIntervalType):
+            delta = DayTimeIntervalType().fromInternal(self._value)
+            if delta is not None and isinstance(delta, datetime.timedelta):
+                try:
+                    import pandas as pd

Review Comment:
   spark connect requires pyarrow/pandas iirc so you won't need to handle 
exceptions here if that's what you're covering



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