spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huaxingao <...@git.apache.org>
Subject [GitHub] spark pull request #22295: [SPARK-25255][PYTHON]Add getActiveSession to Spar...
Date Sat, 08 Sep 2018 01:03:30 GMT
Github user huaxingao commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22295#discussion_r216115581
  
    --- 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())
    +        True
    +        """
    +        return self._jsparkSession.getActiveSession()
    --- End diff --
    
    @HyukjinKwon I add a set of tests. Some of them are borrowed from ```SparkSessionBuilderSuite.scala```


---

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


Mime
View raw message