Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18742#discussion_r131262239
  
    --- Diff: python/pyspark/ml/param/__init__.py ---
    @@ -375,6 +375,18 @@ def copy(self, extra=None):
             that._defaultParamMap = {}
             return self._copyValues(that, extra)
     
    +    def set(self, param, value):
    +        """
    +            Sets the value for a parameter in the parameter map.
    +        """
    +        if not self.hasParam(param.name):
    +            raise TypeError('Invalid param %s given for instance %r. %s' % 
(p.name, self, e))
    --- End diff --
    
    Can you add a test which tries to set this with an invalid Param?  This 
line will not work since e is not defined, but tests pass since this line of 
code is not tested.


---
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

Reply via email to