-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Smart Reruns from Failures/Errors #4017
Conversation
…e/smart-rerun-from-failures
…e/smart-rerun-from-failures
…e/smart-rerun-from-failures
…e/smart-rerun-from-failures
I noticed there a test error that's unrelated to the changes made in this pull request. Succeeded in a previous run with the same command syntax: https://github.com/dbt-labs/dbt/runs/3820843861#step:9:1319 |
The same thing is happening in the latest merge to |
@fclesio, would love for you to try this out! |
…ttps://github.com/dbt-labs/dbt into feature/smart-rerun-from-failures
…e/smart-rerun-from-failures
…e/smart-rerun-from-failures
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.
@sungchun12 @matt-winkler This looks fantastic. I especially appreciate the thoroughness with which you've tested and vested the array of anticipated use cases.
@leahwicz I contributed some of the initial code for this :), so I wouldn't hate if someone on the Core team could give this a quick code review, as a complement to my function review here. (This definitely falls under the Execution
sub-team.) At the same time, it doesn't touch that much code, builds pretty firmly on top of the precedent set by the state:
selection method, and the integration testing looks solid. I could go either way, depending on your comfort level.
(For the moment, I'm just going to commit a quick update to the changelog, since we've released v1.0.0-b1. I have every intention of including this feature in v1.0.0-b2.)
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.
(quick hits to get the tests passing)
test/integration/062_defer_state_test/test_run_results_state.py
Outdated
Show resolved
Hide resolved
test/integration/062_defer_state_test/test_run_results_state.py
Outdated
Show resolved
Hide resolved
test/integration/062_defer_state_test/test_run_results_state.py
Outdated
Show resolved
Hide resolved
test/integration/062_defer_state_test/test_run_results_state.py
Outdated
Show resolved
Hide resolved
test/integration/062_defer_state_test/test_run_results_state.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Jeremy Cohen <[email protected]>
Looks like the adapter tests have changed since the previous commit because they're being skipped now. Let me know if I need to pass a parameter somewhere to get things running. |
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.
The code here is not that big and is limited to the new feature implemented in this pull request, so I think the risk is pretty low. The new code follows the standard of the existing code quite well.
I'd like to have the commits squashed into one and rebased on current main before we merge this though :)
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.
Thanks so much for this contribution, @sungchun12 @matt-winkler!
@gshank I agree re: adding this to main
as a single commit. I think GitHub's squash-merge capabilities could get the job done.
…mart-rerun-from-failures
* Add result: selection method * make a copy for modified state test suite * test case notes * remove macro tests * add a test setup command * copy run results state * passing test case, todos, split work * clean up result:success test case * start with build command and remove previous state where needed * add error result selector tests for seed * add another error seed test case * remove todo * passing build result:error tests * single failure build test * add passing test * fix node assertions for tests * fix tests * draft fail+ tests * add severity to test * result:warn passing test * result:warn+ passing tests * add passing concurrent selector test * add downstream flag * add comment * passing test * fix test for dynamic node selection * add build concurrent selector passing test * add run test cases * add integration tests for dbt test * fix formatting * rename test * remove extra comments * add extra newline * add concurrent selector test / build cases * clean up todos * test all nodes * DRY rebuild code * test all nodes * add TODO update assertion code * cleaner assert code * fix this test to have a fixed set * more cleanup * add changelog * update concurrent selectors on dbt test * remove todo * Update changelog * Apply suggestions from code review Co-authored-by: Jeremy Cohen <[email protected]> * fix changelog * fix Contributors headers Co-authored-by: Jeremy Cohen <[email protected]> Co-authored-by: Matt Winkler <[email protected]> automatic commit by git-black, original commits: 97f31c8
resolves #3891
Description
Instead of having to manually override dbt commands with the models in scope that need to rerun, dbt can now parse the
run_results.json
to do so automatically.Example Usage
First dbt job model has an error.
Rerun dbt job errors and downstream nodes.
Result Selectors in Scope
Note: This pull request does NOT limit which selectors the user can call on from the below list. There are use cases to analyze the nodes for any of these result statuses(ex:
dbt ls --select result:skipped
)result:fail
result:error
result:warn
result:success
result:skipped
result:pass
Testing Approach
Tested result selectors relevant to the commands in scope. For example, you'll see a test for
dbt run --select result:error
, but you won't see a test fordbt run --select result:fail
. This is because aresult:fail
selector will never exist fordbt run
in therun_results.json
.For concurrent selector tests, we tested the most common use cases below.
dbt run --select state:modified+ result:error+ -—defer -—state ./target
dbt build --select state:modified+ result:error+ -—defer -—state ./target
dbt build --select state:modified+ result:error+ result:fail+ --defer --state ./target
dbt test --select result:fail --exclude <example test> -—defer -—state ./target
Checklist
CHANGELOG.md
and added information about my change to the "dbt next" section.