Open christineberger opened 1 year ago
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
Just ran into the same issue
This works fine:
{% set old_etl_relation=adapter.get_relation(
database="DEVELOPMENT",
schema="DBT_GGOHEEN",
identifier="stg_worlds"
) -%}
{{ old_etl_relation }}
But when I try to call one of the audit helper macros, I get a failure:
I'm not sure how you would create an integration test for this, because building a model works fine - it's just the preview that fails.
I think that instead of fixing the readme we can/should fix the various macros!
Describe the bug
The compare_relations macro seems to have an issue with the adapter.get_relation value on the get_filtered_columns_in_relation operation. It seems to work with an {% if execute %} wrapper, though.
Steps to reproduce
Copy the code from the README for compare_relations, then use it as-is, swapping the adapter.get_relations call to an accessible table. Try to run the macro - you will get an error with an empty value.
Expected results
A summarized comparison between the two datasets. Using Benoit's suggestion from an internal channel, the macro works fine like this:
Actual results
With the snippet in the README:
Benoit's version:
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
: 1.6.0 - dbt CloudThe operating system you're using: Mac / Arc Browser
The output of
python --version
:Additional context
It's fine if things now need to be wrapped in
if execute
, but the README should reflect!Are you interested in contributing the fix?
Would love to, but don't have time to solution if needed 🥲