-
Notifications
You must be signed in to change notification settings - Fork 179
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
Test incremental model with unique key both as string and list #96
Conversation
e96e7ff
to
b09dc94
Compare
b09dc94
to
d345426
Compare
Aaaannd all systems green 🚀 ready once more for review |
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.
This looks good to me! I appreciate the edge cases covered here. No request changes from me, but I'm leaving approval up to another reviewer 👍
tests/integration/incremental_unique_id_test/test_incremental_unique_id.py
Outdated
Show resolved
Hide resolved
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.
This looks great. It covered all of the possible cases as far as I can tell. Added a few nitpicking comment for naming stuff.
tests/integration/incremental_unique_id_test/test_incremental_unique_id.py
Outdated
Show resolved
Hide resolved
tests/integration/incremental_unique_id_test/test_incremental_unique_id.py
Outdated
Show resolved
Hide resolved
tests/integration/incremental_unique_id_test/test_incremental_unique_id.py
Outdated
Show resolved
Hide resolved
tests/integration/incremental_unique_id_test/test_incremental_unique_id.py
Show resolved
Hide resolved
Revised the test for failures to be more accurate and performed a bit of renaming. I also folded two methods into setup that didn't need their own level of abstraction.
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 great to me!
Resolves #91
Adds tests to this adapter for unique key changes in PR 4618 in dbt-core.
Description
Adds three classes to mirror the branching paths (unique_key as string, list, both). I tried not to duplicate tests already found in dbt-core. Where possible, I followed existing conventions (e.g. using expected SQL models for comparison). There's a ton of side effects by virtue of model building, but I've attempted to keep things readable by separating out steps into functions.
To help, I've added intention based documentation where possible, but feel free to request more!
I've written a set of tests that not only covers several ways to specify
unique_key
but also simulates real-world incremental update behavior. In doing so, these tests ensure model build and uniqueness semantics are carried out. I mocked up examples in a jaffle_shop first since incremental behavior is a bit wonky at first.Because incremental model behavior requires multiple runs to display, I opted for actual model files as opposed to queries in code.
edit: Sorry for the force pushes. I had to tease out last minute an error due to mission
unique_key
in an integration test. It was passing locally but here until I got the parameters just right. Just one of those bugs! Should be reliably resolved though. And then this PR fell prey to the Jinja dependency failure. Integration tests are passing locally.Ps: I have also been requested to create documentation for Leona to update community docs and am midway through its production. I've already met with @runleonarun synchronously and showed her a lot of the new featureset added. Would be happy to share this with the team.
Checklist
CHANGELOG.md
and added information about my change to the "dbt-snowflake next" section.