Open Blackbaud-PatrickMcDonald opened 3 years ago
Hi, I'm seeing a similar issue with this anomaly check as well on EMR 6.40 (spark 3.1.2) running deequ 2.0.0. This is the exception I get:
java.lang.NoClassDefFoundError: breeze/stats/package$
at com.amazon.deequ.anomalydetection.BatchNormalStrategy.detect(BatchNormalStrategy.scala:75)
at com.amazon.deequ.anomalydetection.AnomalyDetector.detectAnomaliesInHistory(AnomalyDetector.scala:98)
at com.amazon.deequ.anomalydetection.AnomalyDetector.isNewPointAnomalous(AnomalyDetector.scala:60)
at com.amazon.deequ.checks.Check$.isNewestPointNonAnomalous(Check.scala:1138)
at com.amazon.deequ.checks.Check.$anonfun$isNewestPointNonAnomalous$1(Check.scala:433)
at scala.runtime.java8.JFunction1$mcZD$sp.apply(JFunction1$mcZD$sp.java:23)
at com.amazon.deequ.constraints.AnalysisBasedConstraint.runAssertion(AnalysisBasedConstraint.scala:108)
at com.amazon.deequ.constraints.AnalysisBasedConstraint.pickValueAndAssert(AnalysisBasedConstraint.scala:74)
at com.amazon.deequ.constraints.AnalysisBasedConstraint.$anonfun$evaluate$2(AnalysisBasedConstraint.scala:60)
import com.amazon.deequ.anomalydetection.BatchNormalStrategy
def batchNormalStrategyTest() = {
val strategy = BatchNormalStrategy(lowerDeviationFactor=Some(3.0), upperDeviationFactor=Some(3.0))
datasetVerificationRunner(df, {v: VerificationRunBuilderWithRepository => v.addAnomalyCheck(strategy, Compliance("column_1", "cardinality(column_1) > 0"))})
}
batchNormalStrategyTest()
The datasetVerificationRunner
function is simply building a VerificationRunBuilderWithRepository
and applying the higher order function on it to add an AnomalyCheck (It is structured this way because my intention is to quickly test out different strategies on a number of different instances of the same dataset).
Basically something like
val verificationResult = addAnomalyCheck(VerificationSuite().onData(df.where(s"date='${date}'")).useRepository(repo).saveOrAppendResult(newKey)).run()
val resultDf = checkResultsAsDataFrame(spark, verificationResult)
Is this a known issue with this class or am I using it incorrectly in this case?
For anyone having trouble running it on Databricks - it seems to be a conflict between breeze
dependency versions - DBR 7.3 and later use 1.x which conflicts with Deequ's 0.13.2
Possible to verify if the issue go away with latest mainline?
pip install git+https://github.com/awslabs/python-deequ.git@7ec9f6f72839779f370a4753c0db26d6cf052203
I still have the same error too using databricks DBR 11.3 with spark 3.3.0 and DBR 12.2 with spark 3.3.2. im using pydeequ 1.2 deequ 2.0.4
Environment: Databricks Spark 3.0.1 Scala 2.12.10 Java 1.8.0_282 deequ:1.2.2-spark-3.0 pydeequ 1.0.1
I'm attempting to use the BatchNormal anomaly detector strategy and it is throwing the following exception:
To reproduce:
Is this a compatibility issue with the version of Breeze being used?