-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
Is this a new bug in dbt-core?
- I believe this is a new bug in dbt-core
- I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
When a callback configured for a programmatic execution using the dbtRunner class fails, the exception doesn't propagate to the main thread. Instead, the dbt execution doesn't understand that the callback failed and keeps waiting for the process indefinitely
from dbt_common.events.base_types import EventMsg
def print_version_callback(event: EventMsg):
if event.info.name == "NodeFinished":
try:
1/0
except:
traceback.print_exc()
raise Exception("This should let continue the execution registering the failure")
dbt = dbtRunner(callbacks=[print_version_callback])
dbt.invoke(dbt_commands)
Expected Behavior
Exceptions are propagated to the main thread, and callback failures are handled correctly
Steps To Reproduce
- Create a callback that will fail, using the NodeFinished event name
- Attach the callback to a dbtRunner instance
- Run dbt commands
Relevant log output
Environment
- OS: Ubuntu 24.04.2 LTS
- Python: 3.12.3
- dbt: 1.9.4
Which database adapter are you using with dbt?
spark
Additional Context
No response
sf-git