Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix print_dbt_project_evaluator_issues for BigQuery #503

Merged
merged 4 commits into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions macros/on-run-end/print_dbt_project_evaluator_issues.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 {{db_schema}}.{{name_model_checked}}
select * from {{ model_details.relation_name }}
{% endset %}

{% set query_results = run_query(sql_statement) %}
Expand All @@ -53,4 +48,4 @@
{{ print("\n") }}
{%- endif %}

{% endmacro %}
{% endmacro %}