HyukjinKwon commented on code in PR #46002:
URL: https://github.com/apache/spark/pull/46002#discussion_r1562004935


##########
python/pyspark/sql/connect/session.py:
##########
@@ -1034,6 +1034,20 @@ def profile(self) -> Profile:
 
     profile.__doc__ = PySparkSession.profile.__doc__
 
+    def __custom_reduce_handler__(self) -> Tuple:

Review Comment:
   Can we leverage `__reduce__`,  call `SparkSession.getActiveSession`, and 
throw an exception if it returns `None`? We can also add an explicit session ID 
validation by `self._session_id == new._session_id` comparison, and would not 
have to bother with the custom dispatcher stuff.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to