add precision + exclude_columns option to equality test#765
add precision + exclude_columns option to equality test#765gwenwindflower merged 19 commits intodbt-labs:mainfrom rlh1994:add-precision-to-equality-test
Conversation
|
@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 |
joellabes
left a comment
There was a problem hiding this comment.
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 |
|
Hey @joellabes just wondering if you know when you'll have a chance to look at this please? |
|
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 |
gwenwindflower
left a comment
There was a problem hiding this comment.
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
mainbranch (default).Description & motivation
This adds an argument to the
equalitytest that allows for floating point columns (columnis_numericoris_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 0dbt.type_*macros instead of explicit datatypes (e.g.dbt.type_timestamp()instead ofTIMESTAMP