diff --git a/pydeequ/checks.py b/pydeequ/checks.py index 4a2d4e8..abf94d0 100644 --- a/pydeequ/checks.py +++ b/pydeequ/checks.py @@ -555,7 +555,7 @@ def satisfies(self, columnCondition, constraintName, assertion=None, hint=None): assertion_func = ( ScalaFunction1(self._spark_session.sparkContext._gateway, assertion) if assertion - else getattr(self._Check, "satisfies$default$2")() + else getattr(self._Check, "satisfies$default$3")() ) hint = self._jvm.scala.Option.apply(hint) self._Check = self._Check.satisfies(columnCondition, constraintName, assertion_func, hint) diff --git a/tests/test_checks.py b/tests/test_checks.py index ae2402d..53ed53c 100644 --- a/tests/test_checks.py +++ b/tests/test_checks.py @@ -1122,9 +1122,8 @@ def test_fail_hasCorrelation(self): self.assertEqual(self.hasCorrelation("b", "e", lambda x: x == -1), [Row(constraint_status="Failure")]) def test_satisfies(self): - # TODO: test without assertion - # self.assertEqual(self.satisfies('b >=2', 'b greater than or equal to 2'), - # [Row(constraint_status='Failure')]) + self.assertEqual(self.satisfies('b >=2', 'b greater than or equal to 2'), + [Row(constraint_status='Failure')]) self.assertEqual(self.satisfies("b >=2", "b", lambda x: x == 2 / 3), [Row(constraint_status="Success")]) self.assertEqual( self.satisfies("b >=2 AND d >= 2", "b and d", lambda x: x == 2 / 3), [Row(constraint_status="Success")]