This is an automated email from the ASF dual-hosted git repository.

uros-b pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.x by this push:
     new cb72539483e7 [MINOR][PYTHON] Fix try_to_date docstring typo
cb72539483e7 is described below

commit cb72539483e75f3b57d999bd32918514040a8a79
Author: Matthew Hawkes_ONS <[email protected]>
AuthorDate: Sat Jun 20 01:57:57 2026 +0200

    [MINOR][PYTHON] Fix try_to_date docstring typo
    
    ### What changes were proposed in this pull request?
    
    This PR fixes a docstring typo in `pyspark.sql.functions.try_to_date`.
    
    The current docstring says that `try_to_date` is a special version of 
`try_to_date`, which is self-referential. It should say that `try_to_date` is a 
special version of `to_date`, matching the actual relationship and the wording 
used by similar `try_` functions.
    
    ### Why are the changes needed?
    
    The current wording appears to be a typo.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Not applicable. This PR only corrects a docstring typo.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #56618 from mh0w/patch-1.
    
    Authored-by: Matthew Hawkes_ONS <[email protected]>
    Signed-off-by: Uros Bojanic <[email protected]>
    (cherry picked from commit 9d35da89154b8b5f87c1673dfd0cc49ea702f515)
    Signed-off-by: Uros Bojanic <[email protected]>
---
 python/pyspark/sql/functions/builtin.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/pyspark/sql/functions/builtin.py 
b/python/pyspark/sql/functions/builtin.py
index f62dc1d93520..43340405193f 100644
--- a/python/pyspark/sql/functions/builtin.py
+++ b/python/pyspark/sql/functions/builtin.py
@@ -11602,7 +11602,7 @@ def to_date(col: "ColumnOrName", format: Optional[str] 
= None) -> Column:
 
 @_try_remote_functions
 def try_to_date(col: "ColumnOrName", format: Optional[str] = None) -> Column:
-    """This is a special version of `try_to_date` that performs the same 
operation, but returns a
+    """This is a special version of `to_date` that performs the same 
operation, but returns a
     NULL value instead of raising an error if date cannot be created.
 
     .. _datetime pattern: 
https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to