Skip to content

Instantly share code, notes, and snippets.

@timgent
Last active August 8, 2020 08:19
Show Gist options
  • Save timgent/81df96277ea3e5146226979213357ba9 to your computer and use it in GitHub Desktop.
Save timgent/81df96277ea3e5146226979213357ba9 to your computer and use it in GitHub Desktop.
val ordersChecks = ChecksSuite("orders",
singleDsChecks = Map(
DescribedDs(orders, "orders") -> Seq(
SingleMetricCheck.complianceCheck(AbsoluteThreshold(0.9, 1),
ComplianceFn(col("orderType") === "Sale")),
SingleMetricCheck.complianceCheck(AbsoluteThreshold(1, 1),
ComplianceFn(col("orderValue") < 0),
MetricFilter(col("orderType") === "Refund")),
SingleMetricCheck.distinctValuesCheck(AbsoluteThreshold(Some(20), None),
List("itemId")),
SingleMetricCheck.sizeCheck(AbsoluteThreshold(Some(100), None))
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment