diff options
Diffstat (limited to 'python/pyspark/ml/util.py')
-rw-r--r-- | python/pyspark/ml/util.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/python/pyspark/ml/util.py b/python/pyspark/ml/util.py index d7a813f56c..42801c91bb 100644 --- a/python/pyspark/ml/util.py +++ b/python/pyspark/ml/util.py @@ -161,6 +161,9 @@ class JavaMLReader(object): the Python full class name. """ java_package = clazz.__module__.replace("pyspark", "org.apache.spark") + if clazz.__name__ in ("Pipeline", "PipelineModel"): + # Remove the last package name "pipeline" for Pipeline and PipelineModel. + java_package = ".".join(java_package.split(".")[0:-1]) return ".".join([java_package, clazz.__name__]) @classmethod |