-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Ignore parent tests added edges for build selection #7431
Ignore parent tests added edges for build selection #7431
Conversation
It didn't work when applying the test after the fact 🤷
I'm not sure where to add the relevant tests though :-/ Please advise. The tests I've ran manually (on a real dbt project) were:
|
@b-luu Thanks for the PR - nice work! :) I think
Something like: class TestDownstreamSelection:
@pytest.fixture(scope="class")
def models(self):
return {
"model_a.sql": models_simple_blocking__model_a_sql,
"model_b.sql": models_simple_blocking__model_b_sql,
"test.yml": models_simple_blocking__test_yml,
}
def test_downstream_selection(self, project):
"""Ensure that selecting test+ does not select model_a's other children"""
results = run_dbt(["build", "--select", "model_a not_null_model_a_id+"], expect_pass=False)
assert len(results) == 2 This fails on current (While here, I noticed that we need to update our |
Thanks @jtcohen6 🙏 I've added that, just changing So everything should be ready, please let me know if I can help in any other way. |
Ok, the first test is clearly a false positive: now that we've fixed dbt build to match the other commands (by excluding the parents' tests added edges from selections), some tests that were initially set up to replicate that are now failing. I've fixed the first one in But I can't seem to wrap my head around the second one at Also, I'm having a hard time reproducing because my |
These are now fixed: we no longer run models downstream of tests if only the tests were selected, not the parent model...
Actually it's the same for the second one: So I've also fixed this second test, it should be better now 👍 |
Hey @b-luu. Sorry for the delay in reviewing this one, since there was a non-trivial chance it would make an impact on performance it took me a little longer to try it out across a series of test projects and benchmark results. From what I'm seeing the performance is within the bounds of standard deviation for the use cases I'd expect it to effect. I'm attaching the testing results for the largest and most complex project below for future reference. It's probably worth noting that there were several times where the compile step took considerably longer than expected. Since I'm testing on a local laptop and I wasn't able to reliably duplicate it I've tossed those datapoints. They probably represent a background task on my local machine or some other non-dbt related factor. Still worth noting though :) Test ResultsCompile
PR times: Main times: Result: PR = 3.80% shorter run time List
PR times: Main times: Result: PR = 5.79% shorter run time Run
PR times: Main times: Result: PR = 1.05% longer run time Test
PR times: Main times: Result: PR = 3.53% longer run time |
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 to me.
Awesome 🎉 Thanks for the thorough performance testing and taking the relay on this @iknox-fa 🙏 |
resolves #7289 #5193
Description
Removes the added tests edges (specific to build task) for children and/or parent selection.
This allows to avoid selecting any other nodes that aren't selected with the other dbt commands (list, run, ...).
The added tests edges are still respected for the GraphQueue to follow the execution.
Checklist
or tests are not required/relevant for this PRI have opened an issue to add/update docs, ordocs changes are not required/relevant for this PRchangie new
to create a changelog entry