From dbe13e4e055605717bfff6f782bd6909432cc774 Mon Sep 17 00:00:00 2001 From: Tom Phillips Date: Tue, 1 Oct 2024 17:00:31 +0100 Subject: [PATCH 1/2] Fix reference to table for BigQuery compatibility --- macros/on-run-end/print_dbt_project_evaluator_issues.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros/on-run-end/print_dbt_project_evaluator_issues.sql b/macros/on-run-end/print_dbt_project_evaluator_issues.sql index d94c023e..593624a0 100644 --- a/macros/on-run-end/print_dbt_project_evaluator_issues.sql +++ b/macros/on-run-end/print_dbt_project_evaluator_issues.sql @@ -33,7 +33,7 @@ {% set db_schema = model_database ~ "." ~ model_schema if model_database else model_schema %} {% set sql_statement %} - select * from {{db_schema}}.{{name_model_checked}} + select * from {{ model_details['relation_name'] }} {% endset %} {% set query_results = run_query(sql_statement) %} @@ -53,4 +53,4 @@ {{ print("\n") }} {%- endif %} -{% endmacro %} \ No newline at end of file +{% endmacro %} From 4b3610931648f7a6146f389ece15e27840254527 Mon Sep 17 00:00:00 2001 From: Tom Phillips Date: Thu, 3 Oct 2024 16:59:15 +0100 Subject: [PATCH 2/2] Remove unused vars and use dot notation --- macros/on-run-end/print_dbt_project_evaluator_issues.sql | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/macros/on-run-end/print_dbt_project_evaluator_issues.sql b/macros/on-run-end/print_dbt_project_evaluator_issues.sql index 593624a0..f8fc3104 100644 --- a/macros/on-run-end/print_dbt_project_evaluator_issues.sql +++ b/macros/on-run-end/print_dbt_project_evaluator_issues.sql @@ -25,15 +25,10 @@ {{ print("\n-- " ~ result.node.fqn | join(".") ~ " --") }} {% set unique_id_model_checked = result.node.depends_on.nodes[0] %} - {% set model_details = graph["nodes"][unique_id_model_checked] %} - {% set name_model_checked = model_details.alias %} - {% set model_schema = quote ~ model_details.schema ~ quote %} - {% set model_database = quote ~ model_details.database ~ quote if model_details.database else None %} - {% set db_schema = model_database ~ "." ~ model_schema if model_database else model_schema %} {% set sql_statement %} - select * from {{ model_details['relation_name'] }} + select * from {{ model_details.relation_name }} {% endset %} {% set query_results = run_query(sql_statement) %}