WeichenXu123 commented on code in PR #50324:
URL: https://github.com/apache/spark/pull/50324#discussion_r2007258776


##########
python/pyspark/ml/tuning.py:
##########
@@ -847,9 +850,23 @@ def _fit(self, dataset: DataFrame) -> 
"CrossValidatorModel":
             subModels = [[None for j in range(numModels)] for i in 
range(nFolds)]
 
         datasets = self._kFold(dataset)
+
+        tmp_dfs_path = _get_temp_dfs_path()
+        spark_session = SparkSession.getActiveSession()
         for i in range(nFolds):
-            validation = datasets[i][1].cache()
-            train = datasets[i][0].cache()
+            validation = datasets[i][1]
+            train = datasets[i][0]
+
+            if tmp_dfs_path:

Review Comment:
   then we need to handler the uncache step together in the helper function, 
i.e., it should be  a context manager. is this you want ?



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