Skip to content

Commit 3f424d0

Browse files
authored
Merge branch 'master' into BugFix-IncorrectErrorPct
2 parents 6e704b5 + 6fed17c commit 3f424d0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/test/scala/com/target/data_validator/TestHelpers.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ object TestHelpers {
2525
case "java.lang.Double" => DoubleType
2626
case "java.lang.Boolean" => BooleanType
2727
case "java.lang.Long" => LongType
28+
case "java.lang.Byte" => ByteType
2829
case _ => throw new IllegalArgumentException(s"Unknown type '${v.getClass.getCanonicalName}'")
2930
}
3031

src/test/scala/com/target/data_validator/validator/ColumnSumCheckSpec.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,22 @@ class ColumnSumCheckSpec extends FunSpec with Matchers with TestingSparkSession
212212
assert(!sut.failed)
213213
}
214214

215-
it("upper bound success") {
215+
it("upper bound success with short") {
216216
val check = ColumnSumCheck("foo", maxValue = Some(Json.fromDouble(10).get)) // scalastyle:ignore magic.number
217217
val df = mkDf(spark, "foo" -> List[Short](1, 2, 1))
218218
val sut = ValidatorDataFrame(df, None, None, List(check))
219219
assert(!sut.quickChecks(spark, mkDict())(config))
220220
assert(!sut.failed)
221221
}
222222

223+
it("upper bound success with byte") {
224+
val check = ColumnSumCheck("foo", maxValue = Some(Json.fromDouble(10).get)) // scalastyle:ignore magic.number
225+
val df = mkDf(spark, "foo" -> List[Byte](1, 2, 1))
226+
val sut = ValidatorDataFrame(df, None, None, List(check))
227+
assert(!sut.quickChecks(spark, mkDict())(config))
228+
assert(!sut.failed)
229+
}
230+
223231
it("upper bound failure") {
224232
val check = ColumnSumCheck("foo", maxValue = Some(Json.fromFloat(1).get)) // scalastyle:ignore magic.number
225233
val df = mkDf(spark, "foo" -> List(1L, 1L, 1L))

0 commit comments

Comments
 (0)