juliuszsompolski commented on code in PR #42415:
URL: https://github.com/apache/spark/pull/42415#discussion_r1288632013


##########
python/pyspark/sql/connect/client/core.py:
##########
@@ -628,10 +639,15 @@ def __init__(
         if retry_policy:
             self._retry_policy.update(retry_policy)
 
-        # Generate a unique session ID for this client. This UUID must be 
unique to allow
-        # concurrent Spark sessions of the same user. If the channel is 
closed, creating
-        # a new client will create a new session ID.
-        self._session_id = str(uuid.uuid4())
+        if self._builder.session_id is None:
+            # Generate a unique session ID for this client. This UUID must be 
unique to allow
+            # concurrent Spark sessions of the same user. If the channel is 
closed, creating
+            # a new client will create a new session ID.
+            self._session_id = str(uuid.uuid4())
+        else:
+            # Use the pre-defined session ID.
+            self._session_id = str(self._builder.session_id)

Review Comment:
   if not throw INVALID_HANDLE.FORMAT error-class (which has been missing in 
python, @HyukjinKwon is following up)



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