From 83e6af4b9d991fd6e274c604b4c44b4331b41f7d Mon Sep 17 00:00:00 2001 From: mgorsk1 Date: Thu, 21 Nov 2024 19:08:13 +0100 Subject: [PATCH] fix test case param definition --- .../ingestion/source/database/dbt/dbt_utils.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ingestion/src/metadata/ingestion/source/database/dbt/dbt_utils.py b/ingestion/src/metadata/ingestion/source/database/dbt/dbt_utils.py index cfea724f62a5..8860ad99b339 100644 --- a/ingestion/src/metadata/ingestion/source/database/dbt/dbt_utils.py +++ b/ingestion/src/metadata/ingestion/source/database/dbt/dbt_utils.py @@ -47,8 +47,13 @@ def create_test_case_parameter_definitions(dbt_test): if hasattr(dbt_test, "freshness"): test_case_param_definition = [ { - "name": "freshness", - "displayName": "freshness", + "name": "warn_after", + "displayName": "warn_after", + "required": False, + }, + { + "name": "error_after", + "displayName": "error_after", "required": False, } ] @@ -77,9 +82,12 @@ def create_test_case_parameter_values(dbt_test): ] return test_case_param_values if hasattr(manifest_node, "freshness"): - value = ",".join([f"{check}: {spec['count']} {spec['period']}" for check, spec in manifest_node.freshness.items()]) + warn_after = manifest_node.freshness.warn_after + error_after = manifest_node.freshness.error_after + test_case_param_values = [ - {"name": "freshness", "value": value} + {"name": "error_after", "value": f"{error_after.count} {error_after.period.value}"}, + {"name": "warn_after", "value": f"{warn_after.count} {warn_after.period.value}"}, ] return test_case_param_values except Exception as err: # pylint: disable=broad-except