You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2020/07/02 12:05:48 UTC

[spark] branch branch-3.0 updated: [MINOR][DOCS] Pyspark getActiveSession docstring

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 <an...@mail.com>
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)
    
    ![image](https://user-images.githubusercontent.com/6907950/86331522-d7b6f800-bc66-11ea-998c-42085f5e5b04.png)
    
    ### 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 <an...@mail.com>
    Signed-off-by: HyukjinKwon <gu...@apache.org>
    (cherry picked from commit 45fe6b62a73540ff010317fc7518b007206707d6)
    Signed-off-by: HyukjinKwon <gu...@apache.org>
---
 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: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org