-
Notifications
You must be signed in to change notification settings - Fork 509
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
equality
test passes when first table has a subset of second tables columns
#785
Closed
1 of 5 tasks
Labels
bug
Something isn't working
Comments
18 tasks
Yep I think doing this as part of 765 makes sense! Thanks @rlh1994 |
rlh1994
added a commit
to rlh1994/dbt-utils
that referenced
this issue
May 2, 2023
rlh1994
added a commit
to rlh1994/dbt-utils
that referenced
this issue
May 22, 2023
rlh1994
added a commit
to rlh1994/dbt-utils
that referenced
this issue
May 22, 2023
rlh1994
added a commit
to rlh1994/dbt-utils
that referenced
this issue
Sep 25, 2023
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-merge-queue bot
pushed a commit
that referenced
this issue
Mar 5, 2024
* add exclude columns to equality test * add precision option to equality test * CI fix? * CI fix 2.0 * Update CHANGELOG.md * Check for subset of columns (Close #785) * cast type * cast type across warehouses * swap to copiler error, account for ignore columns * Update CL * allow for different cased names * fix CL * linting * Rename to exclude_columns * Fix typo * Add package-lock.yaml to .gitignore * Update comments --------- Co-authored-by: bruno <[email protected]> Co-authored-by: Joel Labes <[email protected]> Co-authored-by: gwen windflower <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When the
equality
test is used to compare two models andcompare_columns
is not provided the macro currently gets the list of columns from the first model only. If there are additional or different columns in this model when compared withcompare_model
the sql will fail to run and return an error, however when this first model contains a subset of the columns from the compare column no error occurs.Steps to reproduce
compare_model
set to the second seed, and the inversedbt deps
,dbt seed
,dbt test
. The first test should pass, but the second will fail.Expected results
Both tests would fail in the same way, or a custom alert would warn me the columns are different.
Actual results
Test 1 passes, test 2 fails.
Screenshots and log output
System information
Which database are you using dbt with?
The output of
dbt --version
:Additional context
dbt-utils/macros/generic_tests/equality.sql
Lines 30 to 33 in 9507d6b
Are you interested in contributing the fix?
Sure, I think it should just need to pull the columns from both models and compare them, I could add it as part of #765 to save touching it twice if that's easier.
The text was updated successfully, but these errors were encountered: