Skip to content

Commit 248f50a

Browse files
authored
fix: default assertion for satisfies check. (#183)
1 parent a7ad766 commit 248f50a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pydeequ/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ def satisfies(self, columnCondition, constraintName, assertion=None, hint=None):
555555
assertion_func = (
556556
ScalaFunction1(self._spark_session.sparkContext._gateway, assertion)
557557
if assertion
558-
else getattr(self._Check, "satisfies$default$2")()
558+
else getattr(self._Check, "satisfies$default$3")()
559559
)
560560
hint = self._jvm.scala.Option.apply(hint)
561561
self._Check = self._Check.satisfies(columnCondition, constraintName, assertion_func, hint)

tests/test_checks.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,9 +1122,8 @@ def test_fail_hasCorrelation(self):
11221122
self.assertEqual(self.hasCorrelation("b", "e", lambda x: x == -1), [Row(constraint_status="Failure")])
11231123

11241124
def test_satisfies(self):
1125-
# TODO: test without assertion
1126-
# self.assertEqual(self.satisfies('b >=2', 'b greater than or equal to 2'),
1127-
# [Row(constraint_status='Failure')])
1125+
self.assertEqual(self.satisfies('b >=2', 'b greater than or equal to 2'),
1126+
[Row(constraint_status='Failure')])
11281127
self.assertEqual(self.satisfies("b >=2", "b", lambda x: x == 2 / 3), [Row(constraint_status="Success")])
11291128
self.assertEqual(
11301129
self.satisfies("b >=2 AND d >= 2", "b and d", lambda x: x == 2 / 3), [Row(constraint_status="Success")]

0 commit comments

Comments
 (0)