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 regression with cardinality equality when field names are different #367

Closed

Conversation

gnilrets
Copy link

Resolves a bug introduced in #310

This is a:

  • bug fix PR with no breaking changes — please ensure the base branch is master
  • new functionality — please ensure the base branch is the latest dev/ branch
  • a breaking change — please ensure the base branch is the latest dev/ branch

Description & motivation

I started getting a cardinality equality test failure after upgrading from 0.6.2 to 0.6.4 (as part of upgrading dbt from 0.18.1 to 0.19.1). Turns out that the SQL wasn't being written properly when the column being tested and the reference didn't use the same name.

Checklist

NOTE: I would love to have written tests for this but struggled getting started. There didn't seem to be an existing test for this macro, so I didn't have much to go on. Also, when I ran make test target=postgres according to these instructions, I got the error Could not render {{ env_var('POSTGRES_TEST_HOST') }}: Env var required but not provided: 'POSTGRES_TEST_HOST'. It wasn't clear to me how to resolve this without much deeper work, so I gave up.

  • 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
  • I have updated the README.md (if applicable) - N/A
  • I have added tests & descriptions to my models (and macros if applicable)
  • I have added an entry to CHANGELOG.md - Not clear where you want me to put the changes as there's no section for unreleased/upcoming versions.

@gnilrets gnilrets requested a review from clrcrl as a code owner May 17, 2021 18:08
@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 6, 2021

Thanks for this @gnilrets! I'm closing only because this was resolved by #334, which was included in the 0.6.5 release of dbt-utils.

@jtcohen6 jtcohen6 closed this Jun 6, 2021
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.

2 participants