Skip to content
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

Fix microbatch model PartialSuccess status to result in non-zero exit code #11115

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20241209-150711.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix interpretation of `PartialSuccess` to result in non-zero exit code
time: 2024-12-09T15:07:11.391313-06:00
custom:
Author: QMalcolm
Issue: "11114"
1 change: 1 addition & 0 deletions core/dbt/task/runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ def interpret_results(cls, results):
NodeStatus.Error,
NodeStatus.Fail,
NodeStatus.Skipped, # propogate error message causing skip
NodeStatus.PartialSuccess, # because partial success also means partial failure
)
]
return len(failures) == 0
Expand Down
6 changes: 3 additions & 3 deletions tests/functional/microbatch/test_microbatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def models(self):
def test_run_with_event_time(self, project):
# run all partitions from start - 2 expected rows in output, one failed
with patch_microbatch_end_time("2020-01-03 13:57:00"):
_, console_output = run_dbt_and_capture(["run"])
_, console_output = run_dbt_and_capture(["run"], expect_pass=False)

assert "PARTIAL SUCCESS (2/3)" in console_output
assert "Completed with 1 partial success" in console_output
Expand Down Expand Up @@ -652,7 +652,7 @@ def models(self):
def test_run_with_event_time(self, project):
# run all partitions from start - 2 expected rows in output, one failed
with patch_microbatch_end_time("2020-01-03 13:57:00"):
_, console_output = run_dbt_and_capture(["run"])
_, console_output = run_dbt_and_capture(["run"], expect_pass=False)

assert "PARTIAL SUCCESS (2/3)" in console_output
assert "Completed with 1 partial success" in console_output
Expand Down Expand Up @@ -751,7 +751,7 @@ def test_run_with_event_time(self, project):

# run all partitions from start - 2 expected rows in output, one failed
with patch_microbatch_end_time("2020-01-03 13:57:00"):
run_dbt(["run"], callbacks=[event_catcher.catch])
run_dbt(["run"], expect_pass=False, callbacks=[event_catcher.catch])
assert len(event_catcher.caught_events) == 1
self.assert_row_count(project, "microbatch_model", 2)

Expand Down
Loading