wbo4958 commented on code in PR #49547:
URL: https://github.com/apache/spark/pull/49547#discussion_r1920172727


##########
python/pyspark/ml/wrapper.py:
##########
@@ -353,7 +353,7 @@ def copy(self: "JP", extra: Optional["ParamMap"] = None) -> 
"JP":
         if extra is None:
             extra = dict()
         that = super(JavaParams, self).copy(extra)
-        if self._java_obj is not None:
+        if self._java_obj is not None and not isinstance(self._java_obj, str):

Review Comment:
   This is for the case 
   
   evaluator.evaluate(dataset, {evaluator.metricName: "accuracy"}) or 
estimator.fit(dataset, params) which will trigger the copy function. So we need 
to bypass _java_obj which is str in connect



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