You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "WeichenXu123 (via GitHub)" <gi...@apache.org> on 2025/03/12 00:40:55 UTC
Re: [PR] [SPARK-51473][ML][CONNECT] ML transformed dataframe keep a reference to the model [spark]
WeichenXu123 commented on code in PR #50199:
URL: https://github.com/apache/spark/pull/50199#discussion_r1990355750
##########
python/pyspark/ml/util.py:
##########
@@ -185,29 +185,40 @@ def wrapped(self: "JavaWrapper", dataset: "ConnectDataFrame") -> Any:
assert isinstance(self._java_obj, str)
params = serialize_ml_params(self, session.client)
- return ConnectDataFrame(
- TransformerRelation(
- child=dataset._plan, name=self._java_obj, ml_params=params, is_model=True
- ),
- session,
+ plan = TransformerRelation(
+ child=dataset._plan,
+ name=self._java_obj,
+ ml_params=params,
+ is_model=True,
)
elif isinstance(self, Transformer):
from pyspark.ml.connect.proto import TransformerRelation
assert isinstance(self._java_obj, str)
params = serialize_ml_params(self, session.client)
- return ConnectDataFrame(
- TransformerRelation(
- child=dataset._plan,
- name=self._java_obj,
- ml_params=params,
- uid=self.uid,
- is_model=False,
- ),
- session,
+ plan = TransformerRelation(
Review Comment:
what's the previous `ConnectDataFrame` for ?
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org