Github user holdenk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22295#discussion_r214410416
  
    --- Diff: python/pyspark/sql/session.py ---
    @@ -252,6 +252,16 @@ def newSession(self):
             """
             return self.__class__(self._sc, self._jsparkSession.newSession())
     
    +    @since(2.4)
    +    def getActiveSession(self):
    +        """
    +        Returns the active SparkSession for the current thread, returned 
by the builder.
    +        >>> s = spark.getActiveSession()
    +        >>> spark._jsparkSession.getDefaultSession().get().equals(s.get())
    --- End diff --
    
    So normally we try and have doc tests like these be examples of how the 
user should use this. So I would consider getting the active session and then 
doing something a normal user would with it (like paralleling a collection).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to