You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This query is particularly useful when you want to check that a refactored model, or a model that you are moving over from a legacy system, match up.
Usage: The query is best used in dbt Develop so you can interactively check results
{# in dbt Develop #}
{% set old_etl_relation=adapter.get_relation(
database=target.database,
schema="old_etl_schema",
identifier="fct_orders"
) -%}
{% set dbt_relation=ref('fct_orders') %}
{{ audit_helper.compare_relations(
a_relation=old_etl_relation,
b_relation=dbt_relation,
exclude_columns=["loaded_at"],
primary_key="order_id"
) }}
This actually does not work as of writing.
Steps to reproduce
Try the README.md recommended steps to use compare_relations in dbt Cloud IDE:
The error is:
Compilation Error in model compare_rels (models/compare_rels.sql)
Macro get_filtered_columns_in_relation expected a Relation but received the value: None
>in macro _is_relation (macros/jinja_helpers/_is_relation.sql)
> called by macro default__get_filtered_columns_in_relation (macros/sql/get_filtered_columns_in_relation.sql)
> called by macro get_filtered_columns_in_relation (macros/sql/get_filtered_columns_in_relation.sql)
> called by macro compare_relations (macros/compare_relations.sql)
> called by model compare_rels (models/compare_rels.sql)
Expected results
No compilation error - and we should be able to preview (and see the results of compare_relation) as the docs suggest.
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.
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.
Describe the bug
According to our README.md:
https://github.com/dbt-labs/dbt-audit-helper#compare_relations-source
This actually does not work as of writing.
Steps to reproduce
Try the README.md recommended steps to use
compare_relations
in dbt Cloud IDE:The error is:
Expected results
No compilation error - and we should be able to preview (and see the results of
compare_relation
) as the docs suggest.Actual results
Error as above.
Screenshots and log output
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
dbt Cloud
The output of
python --version
:Additional context
We can actually compare relations in the IDE - just that we need to use compare_queries instead I think:
Are you interested in contributing the fix?
I think this is just a docs fix?
The text was updated successfully, but these errors were encountered: