You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
Turning on the contract enforcement sends a where false limit 0 query that does not include the SQL header. This can cause failures, e.g. when the sql header is used to declare a variable or temporary function which is referenced in the model query.
results in a query being sent like this, which fails because the variable declared in the header does not exist
select*from (
SELECT DEMO AS demo_text
) as __dbt_sbq
where false
limit0
The model runs successfully without contract enforcement enabled.
Incidentally, the location of the failed SQL is not reported as with regular model / test failures, but the BQ adapter does drop in a link to the failed job in BQ's UI.
github-actionsbot
changed the title
[Bug] Contract enforcement checks do not sent SQL header
[CT-2606] [Bug] Contract enforcement checks do not sent SQL header
May 26, 2023
Is this a new bug in dbt-core?
Current Behavior
Turning on the contract enforcement sends a
where false limit 0
query that does not include the SQL header. This can cause failures, e.g. when the sql header is used to declare a variable or temporary function which is referenced in the model query.Expected Behavior
The sql header should be sent.
Steps To Reproduce
With dbt 1.5 and dbt-bigquery 1.5.1
A simple model with contract enforcement enabled
results in a query being sent like this, which fails because the variable declared in the header does not exist
The model runs successfully without contract enforcement enabled.
Incidentally, the location of the failed SQL is not reported as with regular model / test failures, but the BQ adapter does drop in a link to the failed job in BQ's UI.
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
No response
The text was updated successfully, but these errors were encountered: