Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49692][PYTHON][CONNECT] Refine the string representation of li…
…teral date and datetime ### What changes were proposed in this pull request? Refine the string representation of literal date and datetime ### Why are the changes needed? 1, we should not represent those literals with internal values; 2, the string representation should be consistent with PySpark Classic if possible (we cannot make sure the representations are always the same because we only hold an unresolved expression in connect, but we can try our best to do so) ### Does this PR introduce _any_ user-facing change? yes before: ``` In [3]: lit(datetime.date(2024, 7, 10)) Out[3]: Column<'19914'> In [4]: lit(datetime.datetime(2024, 7, 10, 1, 2, 3, 456)) Out[4]: Column<'1720544523000456'> ``` after: ``` In [3]: lit(datetime.date(2024, 7, 10)) Out[3]: Column<'2024-07-10'> In [4]: lit(datetime.datetime(2024, 7, 10, 1, 2, 3, 456)) Out[4]: Column<'2024-07-10 01:02:03.000456'> ``` ### How was this patch tested? added tests ### Was this patch authored or co-authored using generative AI tooling? no Closes #48137 from zhengruifeng/py_connect_lit_dt. Authored-by: Ruifeng Zheng <[email protected]> Signed-off-by: Ruifeng Zheng <[email protected]>
- Loading branch information