diff --git a/.github/scripts/transform_dbt_test_results.py b/.github/scripts/transform_dbt_test_results.py index d2e679264..3badc7a94 100644 --- a/.github/scripts/transform_dbt_test_results.py +++ b/.github/scripts/transform_dbt_test_results.py @@ -108,16 +108,13 @@ # Mapping that defines category names that should be reported for tests # based on their generics TEST_CATEGORIES = { - "macro.athena.test_accepted_range": "incorrect_values", - "macro.dbt_utils.test_accepted_range": "incorrect_values", - "macro.athena.test_accepted_values": "incorrect_values", - "macro.athena.test_not_accepted_values": "incorrect_values", - "macro.dbt_utils.test_not_accepted_values": "incorrect_values", - "macro.athena.test_unique_combination_of_columns": "duplicate_records", - "macro.dbt_utils.test_unique_combination_of_columns": "duplicate_records", - "macro.athena.test_not_null": "missing_values", - "macro.athena.test_is_null": "missing_values", - "macro.athena.test_res_class_matches_pardat": "class_mismatch_or_issue", + "test_accepted_range": "incorrect_values", + "test_accepted_values": "incorrect_values", + "test_not_accepted_values": "incorrect_values", + "test_unique_combination_of_columns": "duplicate_records", + "test_not_null": "missing_values", + "test_is_null": "missing_values", + "test_res_class_matches_pardat": "class_mismatch_or_issue", } # Fallback for tests whose category we can't determine from either the # test name, the `meta.category` attribute, or the TEST_CATEGORIES mapping @@ -1184,16 +1181,15 @@ def get_category_from_node(node: typing.Dict) -> str: return meta_category for dependency_macro in node["depends_on"]["macros"]: - if custom_test_name := TEST_CATEGORIES.get(dependency_macro): + # Macro names in the DAG are fully qualified following the pattern + # `macro..`, so remove the prefix to extract + # just the name of the macro + cleaned_macro_name = dependency_macro.split(".")[-1] + if custom_test_name := TEST_CATEGORIES.get(cleaned_macro_name): return custom_test_name - # Custom generic tests are always formatted like - # macro.dbt.test_ - if dependency_macro.startswith("macro.athena.test_"): - return dependency_macro.split("macro.athena.test_")[-1] - # dbt_utils generic tests are always formatted like - # macro.dbt_utils.test_ - if dependency_macro.startswith("macro.dbt_utils.test_"): - return dependency_macro.split("macro.dbt_utils.test_")[-1] + # Custom generic tests are always formatted like test_ + if cleaned_macro_name.startswith("test_"): + return cleaned_macro_name.split("test_")[-1] return DEFAULT_TEST_CATEGORY diff --git a/dbt/package-lock.yml b/dbt/package-lock.yml deleted file mode 100644 index eddc3beae..000000000 --- a/dbt/package-lock.yml +++ /dev/null @@ -1,4 +0,0 @@ -packages: -- package: dbt-labs/dbt_utils - version: 1.1.1 -sha1_hash: a158c48c59c2bb7d729d2a4e215aabe5bb4f3353 diff --git a/dbt/packages.yml b/dbt/packages.yml deleted file mode 100644 index 60f8dfb7a..000000000 --- a/dbt/packages.yml +++ /dev/null @@ -1,3 +0,0 @@ -packages: - - package: dbt-labs/dbt_utils - version: 1.1.1 diff --git a/dbt/tests/generic/test_sequential_values.sql b/dbt/tests/generic/test_sequential_values.sql index 94dcbf126..8a4cec87e 100644 --- a/dbt/tests/generic/test_sequential_values.sql +++ b/dbt/tests/generic/test_sequential_values.sql @@ -8,7 +8,7 @@ additional_select_columns=[] ) %} - {%- set previous_column_name = "previous_" ~ dbt_utils.slugify(column_name) -%} + {%- set previous_column_name = "previous_" ~ slugify(column_name) -%} {%- if group_by_columns | length() > 0 -%} {%- set select_gb_cols = group_by_columns | join(",") -%}