diff --git a/python/pyspark/sql/session.py b/python/pyspark/sql/session.py index be4fa20a04327..61891c478dbe4 100644 --- a/python/pyspark/sql/session.py +++ b/python/pyspark/sql/session.py @@ -265,7 +265,10 @@ def newSession(self): @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)