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

    https://github.com/apache/spark/pull/12604#discussion_r61016847
  
    --- Diff: python/pyspark/ml/tests.py ---
    @@ -674,8 +676,11 @@ def _compare_pipelines(self, m1, m2):
             if isinstance(m1, JavaParams):
                 self.assertEqual(len(m1.params), len(m2.params))
                 for p in m1.params:
    -                self.assertEqual(m1.getOrDefault(p), m2.getOrDefault(p))
    -                self.assertEqual(p.parent, m2.getParam(p.name).parent)
    +                # Prevent key not found error in case of some param 
neither in paramMap and
    +                # defaultParamMap.
    +                if p in m1._paramMap or p in m1._defaultParamMap:
    --- End diff --
    
    Use ```m1.isDefined```.
    Also, how about creating a helper method:
    ```
    def _compare_param(m1, m2, paramName)
    ```
    which implements these 3 lines?  That should eliminate some duplicate code.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to