Skip to content

Commit 5b53bdf

Browse files
vadimHyukjinKwon
authored andcommitted
[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]>
1 parent 6af121b commit 5b53bdf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

python/pyspark/sql/functions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,8 @@ def when(condition: Column, value: Any) -> Column:
17161716
value :
17171717
a literal value, or a :class:`~pyspark.sql.Column` expression.
17181718
1719+
Examples
1720+
--------
17191721
>>> df.select(when(df['age'] == 2, 3).otherwise(4).alias("age")).collect()
17201722
[Row(age=3), Row(age=4)]
17211723

0 commit comments

Comments
 (0)