Github user jkbradley commented on a diff in the pull request: https://github.com/apache/spark/pull/18888#discussion_r132744793 --- Diff: python/pyspark/ml/pipeline.py --- @@ -242,3 +319,74 @@ def _to_java(self): JavaParams._new_java_obj("org.apache.spark.ml.PipelineModel", self.uid, java_stages) return _java_obj + + +@inherit_doc +class SharedReadWrite(): + """ + Functions for :py:class:`MLReader` and :py:class:`MLWriter` shared between + :py:class:`Pipeline` and :py:class`PipelineModel` + + .. versionadded:: 2.3.0 + """ + + @staticmethod + def checkStagesForJava(stages): + allStagesAreJava = True --- End diff -- Copying @MrBago 's comment here: How about ```allStagesAreJava = all(isinstance(stage, JavaMLWritable) for stage in self.getStages())```?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org