Github user BryanCutler commented on a diff in the pull request: https://github.com/apache/spark/pull/20410#discussion_r164243811 --- Diff: python/pyspark/ml/wrapper.py --- @@ -118,10 +118,9 @@ def _transfer_params_to_java(self): """ Transforms the embedded params to the companion Java object. """ - paramMap = self.extractParamMap() for param in self.params: - if param in paramMap: - pair = self._make_java_param_pair(param, paramMap[param]) + if param in self._paramMap: + pair = self._make_java_param_pair(param, self._paramMap[param]) --- End diff -- The intent would be more clear if you called ``` if self.isSet(param): pair = self._make_java_param_pair(param, self.getOrDefault[param]) ``` And to be 100% consistent with Scala, it might be a good idea to transfer default values anyway. That way, just in case the python default was somehow changed or different than scala it wouldn't cause an issue that would be really hard to detect.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org