Github user huaxingao commented on a diff in the pull request:
https://github.com/apache/spark/pull/19715#discussion_r158347717
--- 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 --
Thanks for spending so much time to review this PR. I will change this.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]