Github user MLnick commented on a diff in the pull request: https://github.com/apache/spark/pull/19715#discussion_r158239692 --- Diff: mllib/src/test/scala/org/apache/spark/ml/feature/QuantileDiscretizerSuite.scala --- @@ -386,19 +382,16 @@ class QuantileDiscretizerSuite testDefaultReadWrite(discretizer) } - test("Both inputCol and inputCols are set") { - val spark = this.spark - import spark.implicits._ - val discretizer = new QuantileDiscretizer() - .setInputCol("input") - .setOutputCol("result") - .setNumBuckets(3) - .setInputCols(Array("input1", "input2")) - val df = sc.parallelize(Array(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)) - .map(Tuple1.apply).toDF("input") - // When both inputCol and inputCols are set, we throw Exception. - intercept[Exception] { - discretizer.fit(df) + test("multiple columns: Both inputCol and inputCols are set") { + intercept[IllegalArgumentException] { + new QuantileDiscretizer().setInputCol("in").setInputCols(Array("in1", "in2")).getInOutCols --- End diff -- I think I slightly prefer to actually test that the error is thrown during `transform`
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org