yoda-mon commented on a change in pull request #34356:
URL: https://github.com/apache/spark/pull/34356#discussion_r735220881
##########
File path: python/pyspark/sql/functions.py
##########
@@ -2131,6 +2131,24 @@ def weekofyear(col: "ColumnOrName") -> Column:
return Column(sc._jvm.functions.weekofyear(_to_java_column(col)))
+def make_date(year: "ColumnOrName", month: "ColumnOrName", day:
"ColumnOrName") -> Column:
+ """
+ Returns a column with date built from the year, month and day columns.
+
+ Examples
+ --------
+ >>> df = spark.createDataFrame([(2020, 6, 26)], ['Y', 'M', 'D'])
+ >>> df.select(make_date(df.Y, df.M, df.D).alias("datefield")).collect()
+ [Row(datefield=datetime.date(2020, 6, 26))]
Review comment:
Isn't it better to add
- `Parameter`
- `Returns`
section and
- `versionadd`
directives ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]