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

    https://github.com/apache/spark/pull/18742#discussion_r131284503
  
    --- Diff: python/pyspark/ml/tests.py ---
    @@ -1957,6 +1964,46 @@ def test_chisquaretest(self):
             self.assertTrue(all(field in fieldNames for field in 
expectedFields))
     
     
    +class DefaultReadWriteTests(SparkSessionTestCase):
    +
    +    def test_default_read_write(self):
    +        temp_path = tempfile.mkdtemp()
    +
    +        lr = LogisticRegression()
    +        lr.setMaxIter(50)
    +        lr.setThreshold(.75)
    +        writer = DefaultParamsWriter(lr)
    +
    +        savePath = temp_path + "/lr"
    +        writer.saveImpl(savePath)
    +
    +        reader = DefaultParamsReadable.read()
    +        lr2 = reader.load(savePath)
    +
    +        self.assertEqual(lr.uid, lr2.uid)
    +        self.assertEqual(lr.extractParamMap(), lr2.extractParamMap())
    +
    +    def test_default_read_write_with_overwrite(self):
    --- End diff --
    
    Since these tests are almost the same, can you combine them to reduce code 
duplication?


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