This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 5b53bdfa830 [SPARK-39032][PYTHON][DOCS] Examples' tag for
pyspark.sql.functions.when()
5b53bdfa830 is described below
commit 5b53bdfa83061c160652e07b999f996fc8bd2ece
Author: vadim <[email protected]>
AuthorDate: Wed Apr 27 16:56:18 2022 +0900
[SPARK-39032][PYTHON][DOCS] Examples' tag for pyspark.sql.functions.when()
### What changes were proposed in this pull request?
Fix missing keyword for `pyspark.sql.functions.when()` documentation.
### Why are the changes needed?
[Documentation](https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.sql.functions.when.html)
is not formatted correctly
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
All tests passed.
Closes #36369 from vadim/SPARK-39032.
Authored-by: vadim <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
---
python/pyspark/sql/functions.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/python/pyspark/sql/functions.py b/python/pyspark/sql/functions.py
index 06fdbf1ed39..019f64b5171 100644
--- a/python/pyspark/sql/functions.py
+++ b/python/pyspark/sql/functions.py
@@ -1716,6 +1716,8 @@ def when(condition: Column, value: Any) -> Column:
value :
a literal value, or a :class:`~pyspark.sql.Column` expression.
+ Examples
+ --------
>>> df.select(when(df['age'] == 2, 3).otherwise(4).alias("age")).collect()
[Row(age=3), Row(age=4)]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]