Repository: deepchecks/deepchecks

Issue:
[BUG] [Vision] condition get a ?! value
**Describe the bug**
Condition on a check get a ?! value without explanation - everything in it seem to pass and the result seems fine.

**To Reproduce**
Run the following kaggle notebook up to the full suite at the end.
https://www.kaggle.com/code/nadavbarak/animalfacesclassification

**Expected behavior**
Check should display the condition failed.

**Screenshots**
![Screen Shot 2022-04-21 at 12 26 18](https://user-images.githubusercontent.com/67195469/164452553-1185a4cf-898d-4cc8-9e8b-26e7f1677f92.png)



Discussion:

Resolving patch:
diff --git a/deepchecks/vision/checks/distribution/image_property_drift.py b/deepchecks/vision/checks/distribution/image_property_drift.py
--- a/deepchecks/vision/checks/distribution/image_property_drift.py
+++ b/deepchecks/vision/checks/distribution/image_property_drift.py
@@ -245,7 +245,7 @@ def condition(result: t.Dict[str, float]) -> ConditionResult:
             if len(failed_properties) > 0:
                 failed_properties = ';\n'.join(f'{p}={d:.2f}' for p, d in failed_properties)
                 return ConditionResult(
-                    False,
+                    ConditionCategory.FAIL,
                     'Earth Mover\'s Distance is above the threshold '
                     f'for the next properties:\n{failed_properties}'
                 )


Test patch:
diff --git a/tests/vision/checks/distribution/image_property_drift_test.py b/tests/vision/checks/distribution/image_property_drift_test.py
--- a/tests/vision/checks/distribution/image_property_drift_test.py
+++ b/tests/vision/checks/distribution/image_property_drift_test.py
@@ -14,6 +14,7 @@
     instance_of,
     all_of,
     calling,
+    matches_regexp,
     raises,
     has_property,
     has_properties,
@@ -24,6 +25,7 @@
 )
 
 from deepchecks.core import CheckResult
+from deepchecks.core.condition import ConditionCategory
 from deepchecks.core.errors import DeepchecksValueError, DeepchecksNotImplementedError
 from deepchecks.vision.datasets.classification.mnist import MNISTData
 from deepchecks.vision.utils.image_properties import default_image_properties
@@ -92,18 +94,32 @@ def test_image_property_drift_condition(coco_train_visiondata, coco_test_visiond
     ))
 
 
-# def contains_failed_condition():
-#     condition_assertion = has_properties({
-#         'is_pass': equal_to(False),
-#         'details': matches(
-#             r'Earth Mover\'s Distance is above the threshold '
-#             r'for the next properties\:\n.*'
-#         )
-#     })
-#     return has_property(
-#         'conditions_results',
-#         contains_exactly(condition_assertion)
-#     )
+def test_image_property_drift_fail_condition(coco_train_visiondata, coco_test_visiondata, device):
+    result = (
+        ImagePropertyDrift()
+        .add_condition_drift_score_not_greater_than(0)
+        .run(coco_train_visiondata, coco_test_visiondata, device=device)
+    )
+
+    assert_that(result, all_of(
+        is_correct_image_property_drift_result(),
+        contains_failed_condition()
+    ))
+
+
+def contains_failed_condition():
+    condition_assertion = has_properties({
+        'is_pass': equal_to(False),
+        'category': equal_to(ConditionCategory.FAIL),
+        'details': matches_regexp(
+            r'Earth Mover\'s Distance is above the threshold '
+            r'for the next properties\:\n.*'
+        )
+    })
+    return has_property(
+        'conditions_results',
+        contains_exactly(condition_assertion)
+    )
 
 
 def contains_passed_condition():