zhengruifeng commented on code in PR #48159:
URL: https://github.com/apache/spark/pull/48159#discussion_r1766141940
##########
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:
yeah, the `pandas` is a mandatory dependency for connect, let me remove this
`try-catch`
--
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]