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.md is ineffective for dbt cloud #56

Closed
jerichomcleod opened this issue Dec 5, 2022 · 3 comments
Closed

README.md is ineffective for dbt cloud #56

jerichomcleod opened this issue Dec 5, 2022 · 3 comments
Labels
bug Something isn't working Stale

Comments

@jerichomcleod
Copy link

Describe the bug

The section compare_column_values -> Advanced usage - dbt Cloud contains a code snippet for replacing the .print_table() function, but the code snippet does not work in dbt cloud.

Steps to reproduce

Use the code snippet

{# in dbt Develop #}

{% set old_etl_relation_query %}
    select * from public.dim_product
    where is_latest
{% endset %}

{% set new_etl_relation_query %}
    select * from {{ ref('dim_product') }}
{% endset %}

{% set audit_query = audit_helper.compare_column_values(
    a_query=old_etl_relation_query,
    b_query=new_etl_relation_query,
    primary_key="product_id",
    column_to_compare="status"
) %}

{% set audit_results = run_query(audit_query) %}

{% do log(audit_results.column_names, info=True) %}
{% for row in audit_results.rows %}
    {% do log(row.values(), info=True) %}
{% endfor %}

As suggested by the readme, where the last 4 lines include the suggested code change to make this compatible with dbt cloud.

The actual expected results can be obtained by instead directly invoking the macro:

{# in dbt Develop #}

{% set old_etl_relation_query %}
    select * from public.dim_product
    where is_latest
{% endset %}

{% set new_etl_relation_query %}
    select * from {{ ref('dim_product') }}
{% endset %}

{{ audit_helper.compare_column_values(
    a_query=old_etl_relation_query,
    b_query=new_etl_relation_query,
    primary_key="product_id",
    column_to_compare="status"
) }}
@jerichomcleod jerichomcleod added the bug Something isn't working label Dec 5, 2022
@joellabes
Copy link
Contributor

@jerichomcleod thanks for this callout - I'd welcome a PR to the readme to improve this!

@github-actions
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 Jul 19, 2023
@github-actions
Copy link

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 Jul 27, 2023
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
Projects
None yet
Development

No branches or pull requests

2 participants