Skip to content

Commit

Permalink
Removed #45 changes and correct spelling mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
SamratMitra authored and SamratMitra committed May 27, 2020
1 parent 51b30f8 commit 954c18f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ This check sums a column in all rows. If the sum applied to the `column` doesn't
| `maxValue` | NumericType | The upper bound of the sum. Type depends on the type of the `column`. |
| `inclusive` | Boolean | Include `minValue` and `maxValue` as part of the range. |

**Note:** If bounds are non-inclusive, and the actual sum is eequal to one of the bounds, the relative error percentage will be undefined.
**Note:** If bounds are non-inclusive, and the actual sum is equal to one of the bounds, the relative error percentage will be undefined.

## Example Config

Expand Down
1 change: 0 additions & 1 deletion src/test/scala/com/target/data_validator/TestHelpers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ object TestHelpers {
case "java.lang.Double" => DoubleType
case "java.lang.Boolean" => BooleanType
case "java.lang.Long" => LongType
case "java.lang.Byte" => ByteType
case _ => throw new IllegalArgumentException(s"Unknown type '${v.getClass.getCanonicalName}'")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,14 @@ class ColumnSumCheckSpec extends FunSpec with Matchers with TestingSparkSession
assert(!sut.failed)
}

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

it("upper bound success with byte") {
val check = ColumnSumCheck("foo", maxValue = Some(Json.fromDouble(10).get)) // scalastyle:ignore magic.number
val df = mkDf(spark, "foo" -> List[Byte](1, 2, 1))
val sut = ValidatorDataFrame(df, None, None, List(check))
assert(!sut.quickChecks(spark, mkDict())(config))
assert(!sut.failed)
}

it("upper bound failure") {
val check = ColumnSumCheck("foo", maxValue = Some(Json.fromFloat(1).get)) // scalastyle:ignore magic.number
val df = mkDf(spark, "foo" -> List(1L, 1L, 1L))
Expand Down

0 comments on commit 954c18f

Please sign in to comment.