-
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
[CT-2179] [Bug] Failing on-run-start does not stop dbt run #7045
Comments
@fradeleo You're right. I'm not sure which change we made in v1.4 would be responsible for this change, but I can confirm that it changed from v1.3 to v1.4: # dbt_project.yml
on-run-start:
- "select error" -- models/my_model.sql
select 1 as id Using v1.4.3, dbt keeps going:
Whereas, with v1.3.2, it stops after the initial hook error:
If I had to guess, we may no longer be checking for a specific type of exception after running hooks...? |
Ah, it looks like this was due to an intentional change that we made:
This way, a failing We don't explicitly document here that
|
Naive solution: Add a conditional here to In either case, we'd be introducing a genuine divergence between the behavior of |
From chatting with @dbeatty10 @MichelleArk @emmyoop What feels bad:
What feels better to me:
@fradeleo I think that would account for your use case — curious to hear if that makes sense to you conceptually? |
@jtcohen6 it would and it does make a lot of sense to me :) |
Doing this "right" will be a larger lift than just a simple fix for a simple regression, so I've opened it up as a new feature request: In the meantime, there are workarounds to achieve this sort of behavior in a multi-step dbt deployment. |
Is this a new bug in dbt-core?
Current Behavior
Hi,
I recently upgraded to dbt core 1.4.3 (from 1.3.0) and dbt bigquery 1.4.1 and I've started noticing that failing on-run-start checks do not stop dbt from running models. Everything was working as expected before the upgrade.
Macro and logs attached below.
Expected Behavior
This setup worked before (dbt 1.3.0). If a single row was returned by the query in the on-run-start check, an error would be raised and dbt run would not start at all.
Steps To Reproduce
In macros folder, create an export_table_check.sql file with the following content (change table name and column name based on your own table in bigq).
In dbt_project:
Relevant log output
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
No response
The text was updated successfully, but these errors were encountered: