grundprinzip commented on code in PR #47215:
URL: https://github.com/apache/spark/pull/47215#discussion_r1665774394


##########
python/pyspark/sql/connect/session.py:
##########
@@ -840,7 +848,13 @@ def stop(self) -> None:
                 # meaning that you can stop local mode, and restart the Spark 
Connect
                 # client with a different remote address.
                 if PySparkSession._activeSession is not None:
-                    PySparkSession._activeSession.stop()
+                    try:
+                        PySparkSession._activeSession.stop()
+                    except Exception as e:
+                        warnings.warn(
+                            "session.stop(): Local Spark Connect Server could 
not be stopped. "
+                            f"Error: ${e}"
+                        )

Review Comment:
   I'm wondering if this one actually needs to be wrapped because. If I'm 
reading this correctly, the PySparkSession._activeSession is actually a Java 
Session.
   
   
![image](https://github.com/apache/spark/assets/3421/4df21480-6b6a-48ab-8708-3c6e960883b5)
   



-- 
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