diff options
author | Xiangrui Meng <meng@databricks.com> | 2016-02-17 18:56:19 -0800 |
---|---|---|
committer | Josh Rosen <joshrosen@databricks.com> | 2016-02-17 18:56:19 -0800 |
commit | 0088b252bf56d391025a19b70af03f3ce6d7574c (patch) | |
tree | 62218a777fba3662476849f5e777308cf9edb11a /mllib/src | |
parent | 9451fed52cb8a00c706b582a0b51d8cd832f9350 (diff) | |
download | spark-0088b252bf56d391025a19b70af03f3ce6d7574c.tar.gz spark-0088b252bf56d391025a19b70af03f3ce6d7574c.tar.bz2 spark-0088b252bf56d391025a19b70af03f3ce6d7574c.zip |
[MINOR][MLLIB] fix mllib compile warnings
This PR fixes some warnings found by `build/sbt mllib/test:compile`.
Author: Xiangrui Meng <meng@databricks.com>
Closes #11227 from mengxr/fix-mllib-warnings-201602.
Diffstat (limited to 'mllib/src')
-rw-r--r-- | mllib/src/test/scala/org/apache/spark/ml/classification/DecisionTreeClassifierSuite.scala | 4 | ||||
-rw-r--r-- | mllib/src/test/scala/org/apache/spark/mllib/fpm/FPGrowthSuite.scala | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/mllib/src/test/scala/org/apache/spark/ml/classification/DecisionTreeClassifierSuite.scala b/mllib/src/test/scala/org/apache/spark/ml/classification/DecisionTreeClassifierSuite.scala index baf6b90839..9169bcd390 100644 --- a/mllib/src/test/scala/org/apache/spark/ml/classification/DecisionTreeClassifierSuite.scala +++ b/mllib/src/test/scala/org/apache/spark/ml/classification/DecisionTreeClassifierSuite.scala @@ -305,7 +305,11 @@ class DecisionTreeClassifierSuite extends SparkFunSuite with MLlibTestSparkConte n.split match { case s: CategoricalSplit => assert(s.leftCategories === Array(1.0)) + case other => + fail(s"All splits should be categorical, but got ${other.getClass.getName}: $other.") } + case other => + fail(s"Root node should be an internal node, but got ${other.getClass.getName}: $other.") } } diff --git a/mllib/src/test/scala/org/apache/spark/mllib/fpm/FPGrowthSuite.scala b/mllib/src/test/scala/org/apache/spark/mllib/fpm/FPGrowthSuite.scala index b9e997c207..dc44c58e97 100644 --- a/mllib/src/test/scala/org/apache/spark/mllib/fpm/FPGrowthSuite.scala +++ b/mllib/src/test/scala/org/apache/spark/mllib/fpm/FPGrowthSuite.scala @@ -16,6 +16,8 @@ */ package org.apache.spark.mllib.fpm +import scala.language.existentials + import org.apache.spark.SparkFunSuite import org.apache.spark.mllib.util.MLlibTestSparkContext import org.apache.spark.util.Utils |