Skip to content

Commit 4944c62

Browse files
committed
applying review comments
1 parent 836a173 commit 4944c62

File tree

6 files changed

+13
-21
lines changed

6 files changed

+13
-21
lines changed

mllib/src/test/scala/org/apache/spark/ml/feature/OneHotEncoderEstimatorSuite.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,7 @@ class OneHotEncoderEstimatorSuite extends MLTest with DefaultReadWriteTest {
398398
firstResultCol = "output")
399399

400400
model.setHandleInvalid("keep")
401-
testTransformerByGlobalCheckFunc[(Double, Vector)](testDF, model, "output") { _ =>
402-
Unit
403-
}
401+
testTransformerByGlobalCheckFunc[(Double, Vector)](testDF, model, "output") { _ => }
404402
}
405403

406404
test("Transforming on mismatched attributes") {

mllib/src/test/scala/org/apache/spark/ml/feature/QuantileDiscretizerSuite.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ class QuantileDiscretizerSuite extends MLTest with DefaultReadWriteTest {
382382
"result1",
383383
"result2",
384384
"result3") { rows =>
385-
assert(rows == expected)
385+
assert(rows === expected)
386386
}
387387

388388
testTransformerByGlobalCheckFunc[(Double, Double, Double)](
@@ -391,7 +391,7 @@ class QuantileDiscretizerSuite extends MLTest with DefaultReadWriteTest {
391391
"result1",
392392
"result2",
393393
"result3") { rows =>
394-
assert(rows == expected)
394+
assert(rows === expected)
395395
}
396396
}
397397

@@ -450,7 +450,7 @@ class QuantileDiscretizerSuite extends MLTest with DefaultReadWriteTest {
450450
"result1",
451451
"result2",
452452
"result3") { rows =>
453-
assert(rows == expected)
453+
assert(rows === expected)
454454
}
455455

456456
testTransformerByGlobalCheckFunc[(Double, Double, Double)](
@@ -459,7 +459,7 @@ class QuantileDiscretizerSuite extends MLTest with DefaultReadWriteTest {
459459
"result1",
460460
"result2",
461461
"result3") { rows =>
462-
assert(rows == expected)
462+
assert(rows === expected)
463463
}
464464
}
465465

mllib/src/test/scala/org/apache/spark/ml/feature/RFormulaSuite.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ class RFormulaSuite extends MLTest with DefaultReadWriteTest {
3434
expected: DataFrame,
3535
expectedAttributes: AttributeGroup*): Unit = {
3636
val resultSchema = formulaModel.transformSchema(dataframe.schema)
37-
assert(resultSchema.json == expected.schema.json)
38-
assert(resultSchema == expected.schema)
37+
assert(resultSchema.json === expected.schema.json)
38+
assert(resultSchema === expected.schema)
3939
val (first +: rest) = expected.schema.fieldNames.toSeq
4040
val expectedRows = expected.collect()
4141
testTransformerByGlobalCheckFunc[A](dataframe, formulaModel, first, rest: _*) { rows =>
4242
assert(rows.head.schema.toString() == resultSchema.toString())
4343
for (expectedAttributeGroup <- expectedAttributes) {
4444
val attributeGroup =
4545
AttributeGroup.fromStructField(rows.head.schema(expectedAttributeGroup.name))
46-
assert(attributeGroup == expectedAttributeGroup)
46+
assert(attributeGroup === expectedAttributeGroup)
4747
}
4848
assert(rows === expectedRows)
4949
}

mllib/src/test/scala/org/apache/spark/ml/feature/SQLTransformerSuite.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ class SQLTransformerSuite extends MLTest with DefaultReadWriteTest {
7474
assert(df.storageLevel != StorageLevel.NONE)
7575
val sqlTrans = new SQLTransformer()
7676
.setStatement("SELECT id + 1 AS id1 FROM __THIS__")
77-
testTransformerByGlobalCheckFunc[Long](
78-
df,
79-
sqlTrans,
80-
"id1") { rows =>
81-
assert(df.storageLevel != StorageLevel.NONE)
82-
}
77+
testTransformerByGlobalCheckFunc[Long](df, sqlTrans, "id1") { _ => }
78+
assert(df.storageLevel != StorageLevel.NONE)
8379
}
8480
}

mllib/src/test/scala/org/apache/spark/ml/feature/VectorIndexerSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ class VectorIndexerSuite extends MLTest with DefaultReadWriteTest with Logging {
127127
MLTestingUtils.checkCopyAndUids(vectorIndexer, model)
128128

129129
// should work
130-
testTransformer[FeatureData](densePoints1, model, "indexed") { r: Row => Unit }
130+
testTransformer[FeatureData](densePoints1, model, "indexed") { _ => }
131131
// should work
132-
testTransformer[FeatureData](sparsePoints1, model, "indexed") { r: Row => Unit }
132+
testTransformer[FeatureData](sparsePoints1, model, "indexed") { _ => }
133133

134134
// If the data is local Dataset, it throws AssertionError directly.
135135
withClue("Did not found expected error message when fit, " +

mllib/src/test/scala/org/apache/spark/ml/feature/Word2VecSuite.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,7 @@ class Word2VecSuite extends MLTest with DefaultReadWriteTest {
227227
.fit(ngramDF)
228228

229229
// Just test that this transformation succeeds
230-
testTransformerByGlobalCheckFunc[(Seq[String], Seq[String])](ngramDF, model, "result") { rows =>
231-
Unit
232-
}
230+
testTransformerByGlobalCheckFunc[(Seq[String], Seq[String])](ngramDF, model, "result") { _ => }
233231
}
234232

235233
}

0 commit comments

Comments
 (0)