surajiyer commented on a change in pull request #28110: [SPARK-31339][WIP] 
L245: Changed PipelineModel(...) to self.cls(...)
URL: https://github.com/apache/spark/pull/28110#discussion_r403871769
 
 

 ##########
 File path: python/pyspark/ml/pipeline.py
 ##########
 @@ -242,7 +242,7 @@ def load(self, path):
             return JavaMLReader(self.cls).load(path)
         else:
             uid, stages = PipelineSharedReadWrite.load(metadata, self.sc, path)
-            return PipelineModel(stages=stages)._resetUid(uid)
+            return self.cls(stages=stages)._resetUid(uid)
 
 Review comment:
   I do see it now in the Scala side. But does it not then make sense to adapt 
the Scala side as well. I'll be honest that I am not a Scala developer, so I 
wouldn't know how to change it correctly without breaking. However, I see no 
reason to NOT change it to use className/self.cls when those variables are 
expected to be a PipelineModel type anyways. By changing it, it just adds a bit 
more flexibility to the way it can be inherited.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to