From 2539f7d755f7fa92394c17ee2a8e811e82883455 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 6 Nov 2025 16:47:02 +0000 Subject: [PATCH] lib360dataquality: PlannedDurationNotPresent check None instead of truthy Ensure that a duration of 0 isn't evaluated to false. Guidance that 0 is an acceptable value. Fixes: https://github.com/ThreeSixtyGiving/dataquality/issues/166 --- lib360dataquality/check_field_present.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib360dataquality/check_field_present.py b/lib360dataquality/check_field_present.py index ab93dd1..b03cf02 100644 --- a/lib360dataquality/check_field_present.py +++ b/lib360dataquality/check_field_present.py @@ -108,7 +108,7 @@ class PlannedDurationNotPresent(FieldNotPresentBase): @exception_to_false def check_field(self, grant): - return (grant["plannedDates"][0].get("duration") or (grant["plannedDates"][0].get("startDate") and grant["plannedDates"][0].get("endDate"))) + return (grant["plannedDates"][0].get("duration") is not None or (grant["plannedDates"][0].get("startDate") and grant["plannedDates"][0].get("endDate"))) def process(self, grant, path_prefix): super().process(grant, path_prefix)