This is an automated email from the ASF dual-hosted git repository. ruifengz 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 f76bc3a843f4 [SPARK-48822][DOCS] Add examples section header to `format_number` docstring f76bc3a843f4 is described below commit f76bc3a843f4216588a29ff14cafdd870fd0254c Author: thomas.hart <thomas.h...@databricks.com> AuthorDate: Wed Jul 10 12:14:05 2024 +0800 [SPARK-48822][DOCS] Add examples section header to `format_number` docstring ### What changes were proposed in this pull request? This PR adds and "Examples" section header to `format_number` docstring. ### Why are the changes needed? To improve the documentation. ### Does this PR introduce any user-facing change? No changes in behavior are introduced. ### How was this patch tested? Existing tests. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #47237 from thomhart31/docs-format_number. Lead-authored-by: thomas.hart <thomas.h...@databricks.com> Co-authored-by: Thomas Hart <thomas.hart...@gmail.com> Signed-off-by: Ruifeng Zheng <ruife...@apache.org> --- python/pyspark/sql/functions/builtin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/pyspark/sql/functions/builtin.py b/python/pyspark/sql/functions/builtin.py index 0ff830e8d48d..6fd8fdfec8ea 100644 --- a/python/pyspark/sql/functions/builtin.py +++ b/python/pyspark/sql/functions/builtin.py @@ -10654,6 +10654,8 @@ def format_number(col: "ColumnOrName", d: int) -> Column: :class:`~pyspark.sql.Column` the column of formatted results. + Examples + -------- >>> spark.createDataFrame([(5,)], ['a']).select(format_number('a', 4).alias('v')).collect() [Row(v='5.0000')] """ --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org