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

README provides guidance that doesn't work #81

Closed
1 of 5 tasks
jeremyyeo opened this issue Aug 31, 2023 · 2 comments
Closed
1 of 5 tasks

README provides guidance that doesn't work #81

jeremyyeo opened this issue Aug 31, 2023 · 2 comments
Labels
bug Something isn't working Stale triage

Comments

@jeremyyeo
Copy link
Contributor

Describe the bug

According to our README.md:

https://github.com/dbt-labs/dbt-audit-helper#compare_relations-source

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:

image

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.

Actual results

Error as above.

Screenshots and log output

System information

packages:
  - package: dbt-labs/audit_helper
    version: 0.9.0

Which database are you using dbt with?

  • postgres
  • redshift
  • bigquery
  • snowflake
  • other (specify: ____________)

The output of dbt --version:

dbt v1.5.0-latest

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:

image

Are you interested in contributing the fix?

I think this is just a docs fix?

@jeremyyeo jeremyyeo added bug Something isn't working triage labels Aug 31, 2023
Copy link

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.

@github-actions github-actions bot added the Stale label Feb 28, 2024
Copy link

github-actions bot commented Mar 7, 2024

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.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale triage
Projects
None yet
Development

No branches or pull requests

1 participant