From db0cec3fce65c88dc9836a4f6b2ae0d5bab0eb20 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Wed, 21 May 2025 13:20:12 +0100 Subject: [PATCH 1/2] tools: Update location of USEFULNESS_TEST_CLASS and QUALITY_TEST_CLASS These were refactored into the additional_test module --- tools/cove_checks.py | 15 +++++++++++---- tools/extract_lib_messages.py | 8 ++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/tools/cove_checks.py b/tools/cove_checks.py index e92a7669..4a607bda 100755 --- a/tools/cove_checks.py +++ b/tools/cove_checks.py @@ -6,9 +6,8 @@ from lib360dataquality.cove.threesixtygiving import ( common_checks_360, - USEFULNESS_TEST_CLASS, - QUALITY_TEST_CLASS, ) +from lib360dataquality.additional_test import TestType from lib360dataquality.cove.settings import COVE_CONFIG from lib360dataquality.cove.schema import Schema360 @@ -78,11 +77,19 @@ def main(): if args.usefulness_only and not args.quality_only: common_checks_360( - context, working_dir, data, schema, test_classes=[USEFULNESS_TEST_CLASS] + context, + working_dir, + data, + schema, + test_classes=[TestType.USEFULNESS_TEST_CLASS], ) elif args.quality_only and not args.usefulness_only: common_checks_360( - context, working_dir, data, schema, test_classes=[QUALITY_TEST_CLASS] + context, + working_dir, + data, + schema, + test_classes=[TestType.QUALITY_TEST_CLASS], ) else: common_checks_360(context, working_dir, data, schema) diff --git a/tools/extract_lib_messages.py b/tools/extract_lib_messages.py index 2f1a3b37..a2a8a321 100644 --- a/tools/extract_lib_messages.py +++ b/tools/extract_lib_messages.py @@ -1,9 +1,9 @@ from lib360dataquality.cove.threesixtygiving import ( TEST_CLASSES, - QUALITY_TEST_CLASS, - USEFULNESS_TEST_CLASS, ) +from lib360dataquality.additional_test import TestType + def run_check(check): test = check( @@ -23,11 +23,11 @@ def run_check(check): def main(): """Extract and print out the error messages from the different classes of additional checks""" print("----------- Quality Tests ----------") - for check in TEST_CLASSES[QUALITY_TEST_CLASS]: + for check in TEST_CLASSES[TestType.QUALITY_TEST_CLASS]: run_check(check) print("----------- Usefulness Tests -------") - for check in TEST_CLASSES[USEFULNESS_TEST_CLASS]: + for check in TEST_CLASSES[TestType.USEFULNESS_TEST_CLASS]: run_check(check) From 0969455a6dfe116a4e8c0eb2cf1c22408fddbad4 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Wed, 21 May 2025 13:32:21 +0100 Subject: [PATCH 2/2] cove: views: Avoid importing the TestType from the module imports TestType is defined in additional_test so avoid stealing it from the import that exists in module `threesixtygiving` --- cove/cove_360/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cove/cove_360/views.py b/cove/cove_360/views.py index a97e0b98..11ada8aa 100644 --- a/cove/cove_360/views.py +++ b/cove/cove_360/views.py @@ -22,7 +22,8 @@ from libcove.lib.exceptions import CoveInputDataError from lib360dataquality.cove.schema import Schema360, ExtensionsError -from lib360dataquality.cove.threesixtygiving import TEST_CLASSES, TestType +from lib360dataquality.cove.threesixtygiving import TEST_CLASSES +from lib360dataquality.additional_test import TestType from lib360dataquality.cove.threesixtygiving import common_checks_360 from cove_360.models import SuppliedDataStatus