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

Mete Can Akar updated SPARK-45611:
----------------------------------
    Description: 
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".}}

{{
{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].{{{{}}{}}}{{{{}}{}}}

  was:
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".}}

{{}}

As a solution, I proposed the PR 
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
>            Priority: Minor
>
> 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".}}
> {{
> {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