Github user yanboliang commented on a diff in the pull request: https://github.com/apache/spark/pull/10962#discussion_r51087340 --- Diff: python/pyspark/ml/param/__init__.py --- @@ -152,13 +152,17 @@ def isDefined(self, param): return self.isSet(param) or self.hasDefault(param) @since("1.4.0") - def hasParam(self, paramName): + def hasParam(self, param): """ - Tests whether this instance contains a param with a given - (string) name. + Tests whether this instance contains a param. """ - param = self._resolveParam(paramName) - return param in self.params + if isinstance(param, Param): + return hasattr(self, param.name) --- End diff -- +1 for accepting only strings. If no strong reasons, keep consistent with Scala is the best choice.
--- 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