nija-at commented on code in PR #46435:
URL: https://github.com/apache/spark/pull/46435#discussion_r1594987550


##########
python/pyspark/sql/connect/session.py:
##########
@@ -287,7 +287,17 @@ def _set_default_and_active_session(cls, session: 
"SparkSession") -> None:
 
     @classmethod
     def getActiveSession(cls) -> Optional["SparkSession"]:
-        return getattr(cls._active_session, "session", None)
+        s = getattr(cls._active_session, "session", None)
+        if s is not None and not s.is_stopped:
+            return s
+        return None
+
+    @classmethod
+    def getDefaultSession(cls) -> Optional["SparkSession"]:

Review Comment:
   I've converted this into a private API: `_getDefaultSession()`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to