[ 
https://issues.apache.org/jira/browse/SPARK-45611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hyukjin Kwon resolved SPARK-45611.
----------------------------------
    Fix Version/s: 4.0.0
       Resolution: Fixed

Issue resolved by pull request 43442
[https://github.com/apache/spark/pull/43442]

> spark.python.pyspark.sql.functions Typo at date_format Function
> ---------------------------------------------------------------
>
>                 Key: SPARK-45611
>                 URL: https://issues.apache.org/jira/browse/SPARK-45611
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 3.5.0
>            Reporter: Mete Can Akar
>            Assignee: Mete Can Akar
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>         Attachments: image-2023-10-19-19-46-22-918.png
>
>
> In the spark.python.pyspark.sql.functions module, at the {{date_format}} 
> method's doctest, there is a typo in the year format.
> Instead of '{{{}MM/dd/yyy'{}}}, it should be {{'MM/dd/yyyy'}} as the expected 
> output{{{}[Row(date='04/08/2015')]{}}} indicates the following format 
> {{"MM/dd/yyyy".}}
>  
> From the official documentation:
> !image-2023-10-19-19-46-22-918.png|width=633,height=365!
> {code:java}
> df = spark.createDataFrame([('2015-04-08',)], ['dt'])
> df.select(date_format('dt', 'MM/dd/yyy').alias('date')).collect()
> [Row(date='04/08/2015')]
> {code}
>  
> As a solution, I proposed the PR [https://github.com/apache/spark/pull/43442].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to