Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-48278][PYTHON][CONNECT] Refine the string representation of `C…
…ast` ### What changes were proposed in this pull request? Refine the string representation of `Cast` ### Why are the changes needed? try the best to make the string representation consistent with Spark Classic ### Does this PR introduce _any_ user-facing change? Spark Classic: ``` In [1]: from pyspark.sql import functions as sf In [2]: sf.col("a").try_cast("int") Out[2]: Column<'TRY_CAST(a AS INT)'> ``` Spark Connect, before this PR: ``` In [1]: from pyspark.sql import functions as sf In [2]: sf.col("a").try_cast("int") Out[2]: Column<'(a (int))'> ``` Spark Connect, after this PR: ``` In [1]: from pyspark.sql import functions as sf In [2]: sf.col("a").try_cast("int") Out[2]: Column<'TRY_CAST(a AS INT)'> ``` ### How was this patch tested? added tests ### Was this patch authored or co-authored using generative AI tooling? no Closes apache#46585 from zhengruifeng/cast_str_repr. Authored-by: Ruifeng Zheng <[email protected]> Signed-off-by: Ruifeng Zheng <[email protected]>
- Loading branch information