zhengruifeng opened a new pull request, #48159:
URL: https://github.com/apache/spark/pull/48159

   ### What changes were proposed in this pull request?
   Refine the string representation of `timedelta`
   
   
   ### Why are the changes needed?
   We should not leak the raw data
   
   
   ### Does this PR introduce _any_ user-facing change?
   yes
   
   PySpark Classic:
   ```
   In [1]: from pyspark.sql import functions as sf
   
   In [2]: import datetime
   
   In [3]: sf.lit(datetime.timedelta(1, 1))
   Out[3]: Column<'PT24H1S'>
   ```
   
   PySpark Connect (before):
   ```
   In [1]: from pyspark.sql import functions as sf
   
   In [2]: import datetime
   
   In [3]: sf.lit(datetime.timedelta(1, 1))
   Out[3]: Column<'86401000000'>
   ```
   
   PySpark Connect (after):
   ```
   In [1]: from pyspark.sql import functions as sf
   
   In [2]: import datetime
   
   In [3]: sf.lit(datetime.timedelta(1, 1))
   Out[3]: Column<'P1DT0H0M1S'>
   ```
   
   
   ### How was this patch tested?
   added test
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   no
   


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