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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tomwphillips
Copy link

This is a:

  • bug fix PR with no breaking changes
  • new functionality

Link to Issue

Closes #502.

Description & motivation

The print_dbt_project_evaluator_issues macro doesn't reference the resource correctly on BigQuery. Specifically, it misses the backticks in select ... from project.dataset.table``. This PR fixes it.

Unsure how to test this without re-working the macro quite substantially. AFAICT, no existing tests either. Open to discussion.

Integration Test Screenshot

See attached logs:

Checklist

  • I have verified that these changes work locally on the following warehouses (Note: it's okay if you do not have access to all warehouses, this helps us understand what has been covered)
    • BigQuery
    • Postgres
    • Redshift
    • Snowflake
    • Databricks
    • DuckDB
    • Trino/Starburst
  • I have updated the README.md (if applicable)
  • I have added tests & descriptions to my models (and macros if applicable)

Copy link
Collaborator

@b-per b-per left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I added a comment to remove some of the variables no longer needed when getting the relation from the graph object.

@@ -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'] }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we can use the . notation here and remove the variables from above as they are no longer needed.

Suggested change
select * from {{ model_details['relation_name'] }}
select * from {{ model_details.relation_name }}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're absolutely right. Fixed that.

…ot-notation

Remove unused vars and use dot notation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

print_dbt_project_evaluator_issues macro broken on BigQuery
2 participants