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


##########
python/pyspark/ml/connect/tuning.py:
##########
@@ -178,11 +178,12 @@ def _parallelFitTasks(
 
     def get_single_task(index: int, param_map: Any) -> Callable[[], Tuple[int, 
float]]:
         def single_task() -> Tuple[int, float]:
-            # Active session is thread-local variable, in background thread 
the active session
-            # is not set, the following line sets it as the main thread active 
session.
-            active_session._jvm.SparkSession.setActiveSession(  # type: 
ignore[union-attr]
-                active_session._jsparkSession  # type: ignore[union-attr]
-            )
+            if not is_remote():

Review Comment:
   cc @WeichenXu123 FYI the related tests were 
`pyspark.ml.tests.connect.test_connect_tuning.CrossValidatorTestsOnConnect`.



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