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 82ffd253520 [SPARK-45773][PYTHON][DOCS] Refine docstring of
SparkSession.builder.config
82ffd253520 is described below
commit 82ffd253520297197fd7c27fe3c907d941124dce
Author: allisonwang-db <[email protected]>
AuthorDate: Mon Nov 6 11:10:15 2023 -0800
[SPARK-45773][PYTHON][DOCS] Refine docstring of SparkSession.builder.config
### What changes were proposed in this pull request?
This PR refines the docstring of the method `SparkSession.builder.config`.
### Why are the changes needed?
To improve PySpark documentation.
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
doc test
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #43639 from allisonwang-db/spark-45773-config.
Authored-by: allisonwang-db <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
---
python/pyspark/sql/session.py | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/python/pyspark/sql/session.py b/python/pyspark/sql/session.py
index 1ffb602ba86..4ab7281d7ac 100644
--- a/python/pyspark/sql/session.py
+++ b/python/pyspark/sql/session.py
@@ -253,12 +253,17 @@ class SparkSession(SparkConversionMixin):
-------
:class:`SparkSession.Builder`
+ See Also
+ --------
+ :class:`SparkConf`
+
Examples
--------
- For an existing class:`SparkConf`, use `conf` parameter.
+ For an existing :class:`SparkConf`, use `conf` parameter.
>>> from pyspark.conf import SparkConf
- >>> SparkSession.builder.config(conf=SparkConf())
+ >>> conf = SparkConf().setAppName("example").setMaster("local")
+ >>> SparkSession.builder.config(conf=conf)
<pyspark.sql.session.SparkSession.Builder...
For a (key, value) pair, you can omit parameter names.
@@ -266,7 +271,13 @@ class SparkSession(SparkConversionMixin):
>>> SparkSession.builder.config("spark.some.config.option",
"some-value")
<pyspark.sql.session.SparkSession.Builder...
- Additionally, you can pass a dictionary of configurations to set.
+ Set multiple configurations.
+
+ >>> SparkSession.builder.config(
+ ... "spark.some.config.number",
123).config("spark.some.config.float", 0.123)
+ <pyspark.sql.session.SparkSession.Builder...
+
+ Set multiple configurations using a dictionary.
>>> SparkSession.builder.config(
... map={"spark.some.config.number": 123,
"spark.some.config.float": 0.123})
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]