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 #11012: Catch DbtRuntimeError for hooks #11023

Merged
merged 2 commits into from
Nov 21, 2024
Merged

Fix #11012: Catch DbtRuntimeError for hooks #11023

merged 2 commits into from
Nov 21, 2024

Conversation

aranke
Copy link
Member

@aranke aranke commented Nov 21, 2024

Resolves #11012

Problem

DbtRuntimeError was not caught for hooks, which resulted in run_results.json not being written.

Solution

Explicitly catch DbtRuntimeError

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.13%. Comparing base (a42303c) to head (5f3dad1).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11023      +/-   ##
==========================================
- Coverage   89.15%   89.13%   -0.03%     
==========================================
  Files         183      183              
  Lines       23764    23764              
==========================================
- Hits        21186    21181       -5     
- Misses       2578     2583       +5     
Flag Coverage Δ
integration 86.43% <100.00%> (-0.10%) ⬇️
unit 62.17% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 62.17% <0.00%> (ø)
Integration Tests 86.43% <100.00%> (-0.10%) ⬇️
---- 🚨 Try these New Features:

@aranke aranke marked this pull request as ready for review November 21, 2024 18:32
@aranke aranke requested a review from a team as a code owner November 21, 2024 18:32
Copy link
Contributor

@gshank gshank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice that it ended up being pretty simple!

@aranke aranke closed this Nov 21, 2024
@aranke aranke reopened this Nov 21, 2024
@aranke aranke added the cla:yes label Nov 21, 2024
@aranke aranke closed this Nov 21, 2024
@aranke aranke reopened this Nov 21, 2024
@aranke aranke merged commit f582ac2 into main Nov 21, 2024
157 of 158 checks passed
@aranke aranke deleted the fix_11012 branch November 21, 2024 22:27
Copy link
Contributor

The backport to 1.8.latest failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.8.latest 1.8.latest
# Navigate to the new working tree
cd .worktrees/backport-1.8.latest
# Create a new branch
git switch --create backport-11023-to-1.8.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f582ac2488c9175ec0d3297336099cf5593acf17
# Push it to GitHub
git push --set-upstream origin backport-11023-to-1.8.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.8.latest

Then, create a pull request where the base branch is 1.8.latest and the compare/head branch is backport-11023-to-1.8.latest.

github-actions bot pushed a commit that referenced this pull request Nov 25, 2024
gshank added a commit that referenced this pull request Nov 25, 2024
(cherry picked from commit f582ac2)

Co-authored-by: Kshitij Aranke <[email protected]>
Co-authored-by: Gerda Shank <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Write run_results.json even if we encounter an exception on main thread
3 participants