Github user jkbradley commented on a diff in the pull request: https://github.com/apache/spark/pull/9090#discussion_r41895595 --- Diff: mllib/src/test/scala/org/apache/spark/ml/param/ParamsSuite.scala --- @@ -21,6 +21,120 @@ import org.apache.spark.SparkFunSuite class ParamsSuite extends SparkFunSuite { + test("json encode/decode") { + val dummy = new Params { + override def copy(extra: ParamMap): Params = defaultCopy(extra) + + override val uid: String = "dummy" + } + + { // BooleanParam + val param = new BooleanParam(dummy, "name", "doc") + for (value <- Seq(true, false)) { + val json = param.jsonEncode(value) + assert(param.jsonDecode(json) === value) + } + } + + { // IntParam + val param = new IntParam(dummy, "name", "doc") --- End diff -- Indentation here and in a few places below.
--- 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