BryanCutler commented on a change in pull request #26527: 
[SPARK-29691][ML][PYTHON] ensure Param objects are valid in fit, transform
URL: https://github.com/apache/spark/pull/26527#discussion_r347548403
 
 

 ##########
 File path: python/pyspark/ml/tuning.py
 ##########
 @@ -88,8 +88,14 @@ def __init__(self):
     def addGrid(self, param, values):
         """
         Sets the given parameters in this grid to fixed values.
+
+        param must be an instance of Param associated with an instance of 
Params
+        (such as Estimator or Transformer).
         """
-        self._param_grid[param] = values
+        if isinstance(param, Param):
 
 Review comment:
   can you add a test for this too?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to