-
Notifications
You must be signed in to change notification settings - Fork 504
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
add precision + exclude_columns option to equality test #765
add precision + exclude_columns option to equality test #765
Conversation
90327e1
to
5ff1911
Compare
5ff1911
to
31405d5
Compare
@rlh1994 this PR would be very useful to me. Any idea why the tests are failing? It looks like errors in seeding on redshift but it's not clear to me why. |
@adammarples I don't think it's related to this change as it seems to be failing across multiple PRs, I was just waiting for @joellabes to review |
f604824
to
845d4cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You and @brunocostalopes have done some great stuff here @rlh1994!
I particularly love the robust set of tests.
I will want to come back and do a deeper read of the specific jinja in the equality.sql file itself, but it makes sense to do that in one hit alongside any changes necessary with #785, as I imagine that'll lead to some changes too.
The good news is that the tests are now up and running again on Redshift, so we should be able to move much faster and more confidence.
@joellabes I've added it in, but a few notes on this final change:
|
also looking forward to this, at the moment the equality silently passes if your comparison model has more columns than the tested model, which seems like unexpected behavior. I believe your fix rectifies this issue. |
Me either, I think this is OK
Yeah it should raise a compiler error. I think that means we can't have a test running for it 😬 but better to do the right thing on the end user's side.
They’ll fail because the data is invalid though, right? So I am OK with that - it's a bug that we're fixing as opposed to deviating from documented behaviour
Ha! Great news 🎉 Will go over this properly soon |
778c45e
to
cda354a
Compare
Hey @joellabes just wondering if you know when you'll have a chance to look at this please? |
983d292
to
4ef3c06
Compare
Redshift failing due to a deadlock, not a failing test |
@rlh1994 I noticed you've updated the |
Ah okay, I went with exclude based on this comment here: #829 (comment) To be honest I have no strong feelings either way and can easily change it once this gets reviewed 😅 |
@brunocostalopes Sorry I had missed your PR as well! It appears that there's a real need for these ignore/exclude columns! ;) It would indeed help avoid a stack of redundant PRs if some of them finally got reviewed/approved @joellabes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Left one comment for consideration but otherwise this seems good to me and everything is passing now in CI. Thanks again for your patience on this!
Love where you landed with the new comments @rlh1994 ! Thanks again for the patience, this is a fantastic addition to the package, really appreciate the work on this one. 💜 |
This has already helped me a ton, thanks for this contribution! |
resolves #757, resolves #734, resolves #785, replaces #737, resolves #828
This is a:
All pull requests from community contributors should target the
main
branch (default).Description & motivation
This adds an argument to the
equality
test that allows for floating point columns (columnis_numeric
oris_float
) to be more easily compared and reducing false errors raised. It is fully backwards compatible (default arguments retain existing behaviour and code), and has been tested on and supports BQ/Postgres/Databricks/Snowflake/Redshift.It also includes a few new tests both positive and negative assertions.
It also includes the work done in #737 to save rebasing if one of these was merged independently.
Finally, it adds a fix for #785 that ensures when no compare/ignore columns list is provided that both tables have the same columns.
Checklist
star()
source)limit_zero()
macro in place of the literal string:limit 0
dbt.type_*
macros instead of explicit datatypes (e.g.dbt.type_timestamp()
instead ofTIMESTAMP