spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject spark git commit: [SPARK-13153][PYSPARK] ML persistence failed when handle no default value parameter
Date Fri, 12 Feb 2016 02:38:51 GMT
Repository: spark
Updated Branches:
  refs/heads/master 5f1c35906 -> d3e2e2029


[SPARK-13153][PYSPARK] ML persistence failed when handle no default value parameter

Fix this defect by check default value exist or not.

yanboliang Please help to review.

Author: Tommy YU <tummyyu@163.com>

Closes #11043 from Wenpei/spark-13153-handle-param-withnodefaultvalue.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d3e2e202
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d3e2e202
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d3e2e202

Branch: refs/heads/master
Commit: d3e2e202994e063856c192e9fdd0541777b88e0e
Parents: 5f1c359
Author: Tommy YU <tummyyu@163.com>
Authored: Thu Feb 11 18:38:49 2016 -0800
Committer: Xiangrui Meng <meng@databricks.com>
Committed: Thu Feb 11 18:38:49 2016 -0800

----------------------------------------------------------------------
 python/pyspark/ml/wrapper.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/d3e2e202/python/pyspark/ml/wrapper.py
----------------------------------------------------------------------
diff --git a/python/pyspark/ml/wrapper.py b/python/pyspark/ml/wrapper.py
index d4d48eb..f8feaa1 100644
--- a/python/pyspark/ml/wrapper.py
+++ b/python/pyspark/ml/wrapper.py
@@ -79,8 +79,9 @@ class JavaWrapper(Params):
         for param in self.params:
             if self._java_obj.hasParam(param.name):
                 java_param = self._java_obj.getParam(param.name)
-                value = _java2py(sc, self._java_obj.getOrDefault(java_param))
-                self._paramMap[param] = value
+                if self._java_obj.isDefined(java_param):
+                    value = _java2py(sc, self._java_obj.getOrDefault(java_param))
+                    self._paramMap[param] = value
 
     @staticmethod
     def _empty_java_param_map():


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message