Github user BryanCutler commented on a diff in the pull request: https://github.com/apache/spark/pull/18982#discussion_r134380293 --- Diff: python/pyspark/ml/tests.py --- @@ -455,6 +455,14 @@ def test_logistic_regression_check_thresholds(self): LogisticRegression, threshold=0.42, thresholds=[0.5, 0.5] ) + def test_preserve_set_state(self): + model = Binarizer() + self.assertFalse(model.isSet("threshold")) + model._transfer_params_to_java() --- End diff -- yeah, it would be a little better to call the actual `transform`, but we would still need to call `_transfer_params_from_java` or check `isSet` with a direct call to Java via py4j. I was going to do this, but the `ParamTest` class doesn't already create a `SparkSession` - I'm sure it's just a small amount of overhead but that's why I thought to just use `_transfer_params_to_java`. Do you think it would be worth it to change `ParamTests` to inherit from `SparkSessionTestCase` so a session is created and I could make a `DataFrame` to transform?
--- 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