You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ru...@apache.org on 2024/07/10 04:14:27 UTC
(spark) branch master updated: [SPARK-48822][DOCS] Add examples section header to `format_number` docstring
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 <th...@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 <th...@databricks.com>
Co-authored-by: Thomas Hart <th...@gmail.com>
Signed-off-by: Ruifeng Zheng <ru...@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-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org