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


##########
python/pyspark/sql/connect/client.py:
##########
@@ -536,12 +572,17 @@ def _execute(self, req: pb2.ExecutePlanRequest) -> None:
         """
         logger.info("Execute")
         try:
-            for b in self._stub.ExecutePlan(req, 
metadata=self._builder.metadata()):
-                if b.client_id != self._session_id:
-                    raise SparkConnectException(
-                        "Received incorrect session identifier for request."
-                    )
-                continue
+            for attempt in Retrying(
+                can_retry=SparkConnectClient.retry_exception, 
**self._retry_policy
+            ):
+                with attempt:
+                    for b in self._stub.ExecutePlan(req, 
metadata=self._builder.metadata()):
+                        if b.client_id != self._session_id:
+                            raise SparkConnectException(
+                                "Received incorrect session identifier for 
request: "
+                                f"{b.client_id} != {self._session_id}"
+                            )
+                        continue

Review Comment:
   nit but seems like we don't need `continue`.



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