Skip to content

Commit

Permalink
corrected failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzej.nescior committed Dec 5, 2023
1 parent 70e9dbf commit 5f1a81e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1262,16 +1262,17 @@ def test_where(self):
self.where(lambda x: x == 2.0, "ssn='000-00-0000'", "column 'ssn' has one value 000-00-0000"),
[Row(constraint_status="Failure")],
)
self.assertRaises(Check(self.spark, CheckLevel.Warning, "test where").kllSketchSatisfies(
"b", lambda x: x.parameters().apply(0) == 1.0, KLLParameters(self.spark, 2, 0.64, 2)
).where("d=5"), TypeError)
check = Check(self.spark, CheckLevel.Warning, "test where").hasMin("f", lambda x: x == 2, "The f has min value 2 becasue of the additional filter").where('f>=2')
result = VerificationSuite(self.spark).onData(self.df).addCheck(check.isGreaterThan("e", "h", lambda x: x == 1, "Column H is not smaller than Column E")).run()
df = VerificationResult.checkResultsAsDataFrame(self.spark, result)
self.assertEqual(
df.select("constraint_status").collect(),
[Row(constraint_status="Success"), Row(constraint_status="Failure")],
)
with self.assertRaises(TypeError):
Check(self.spark, CheckLevel.Warning, "test where").kllSketchSatisfies(
"b", lambda x: x.parameters().apply(0) == 1.0, KLLParameters(self.spark, 2, 0.64, 2)
).where("d=5")

@pytest.mark.xfail(reason="@unittest.expectedFailure")
def test_fail_where(self):
Expand Down

0 comments on commit 5f1a81e

Please sign in to comment.