This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 5361f76 [MINOR][DOCS] Pyspark getActiveSession docstring
5361f76 is described below
commit 5361f76d84de4986aa65a687bece94f4220edd94
Author: animenon <[email protected]>
AuthorDate: Thu Jul 2 21:02:00 2020 +0900
[MINOR][DOCS] Pyspark getActiveSession docstring
### What changes were proposed in this pull request?
Minor fix so that the documentation of `getActiveSession` is fixed.
The sample code snippet doesn't come up formatted rightly, added spacing
for this to be fixed.
Also added return to docs.
### Why are the changes needed?
The sample code is getting mixed up as description in the docs.
[Current Doc
Link](http://spark.apache.org/docs/latest/api/python/pyspark.sql.html?highlight=getactivesession#pyspark.sql.SparkSession.getActiveSession)

### Does this PR introduce _any_ user-facing change?
Yes, documentation of getActiveSession is fixed.
And added description about return.
### How was this patch tested?
Adding a spacing between description and code seems to fix the issue.
Closes #28978 from animenon/docs_minor.
Authored-by: animenon <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
(cherry picked from commit 45fe6b62a73540ff010317fc7518b007206707d6)
Signed-off-by: HyukjinKwon <[email protected]>
---
python/pyspark/sql/session.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/python/pyspark/sql/session.py b/python/pyspark/sql/session.py
index 233f492..e9486a3 100644
--- a/python/pyspark/sql/session.py
+++ b/python/pyspark/sql/session.py
@@ -265,7 +265,10 @@ class SparkSession(SparkConversionMixin):
@since(3.0)
def getActiveSession(cls):
"""
- Returns the active SparkSession for the current thread, returned by
the builder.
+ Returns the active SparkSession for the current thread, returned by
the builder
+
+ :return: :class:`SparkSession` if an active session exists for the
current thread
+
>>> s = SparkSession.getActiveSession()
>>> l = [('Alice', 1)]
>>> rdd = s.sparkContext.parallelize(l)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]