Skip to content

Commit

Permalink
add test case param definition
Browse files Browse the repository at this point in the history
  • Loading branch information
mgorsk1 committed Nov 21, 2024
1 parent 3ea615d commit 79da538
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ingestion/src/metadata/ingestion/source/database/dbt/dbt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ def create_test_case_parameter_definitions(dbt_test):
}
]
return test_case_param_definition
if hasattr(dbt_test, "freshness"):
test_case_param_definition = [
{
"name": "freshness",
"displayName": "freshness",
"required": False,
}
]
return test_case_param_definition
except Exception as err: # pylint: disable=broad-except
logger.debug(traceback.format_exc())
logger.error(
Expand All @@ -67,6 +76,12 @@ def create_test_case_parameter_values(dbt_test):
{"name": manifest_node.test_metadata.name, "value": dbt_test_values}
]
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()])
test_case_param_values = [
{"name": "freshness", "value": value}
]
return test_case_param_values
except Exception as err: # pylint: disable=broad-except
logger.debug(traceback.format_exc())
logger.error(
Expand Down

0 comments on commit 79da538

Please sign in to comment.