Skip to content

Commit

Permalink
[SPARK-45611][PYTHON][DOCS] Typo fixed yyy to yyyy at date_format fun…
Browse files Browse the repository at this point in the history
…ction

Based on the issue https://issues.apache.org/jira/browse/SPARK-45611

### What changes were proposed in this pull request?
In 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"`

### Was this patch authored or co-authored using generative AI tooling?
No

Closes #43442 from metecanakar/fix/typo-in-data-format.

Lead-authored-by: Mete Can Akar <metecanakar@gmail.com>
Co-authored-by: Mete Can Akar <10785597+metecanakar@users.noreply.github.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
  • Loading branch information
2 people authored and HyukjinKwon committed Oct 20, 2023
1 parent 69fa51c commit 6953b00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/pyspark/sql/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6784,7 +6784,7 @@ def date_format(date: "ColumnOrName", format: str) -> Column:
Examples
--------
>>> df = spark.createDataFrame([('2015-04-08',)], ['dt'])
>>> df.select(date_format('dt', 'MM/dd/yyy').alias('date')).collect()
>>> df.select(date_format('dt', 'MM/dd/yyyy').alias('date')).collect()
[Row(date='04/08/2015')]
"""
return _invoke_function("date_format", _to_java_column(date), format)
Expand Down

0 comments on commit 6953b00

Please sign in to comment.