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
When specifying the env var DBT_DEFER_STATE=stateprod, it appears to be considered even when you try to overrule the state manually using dbt test --defer --state state (non-prod)
The following example results in stateprod being used as state.
When doing the same with DBT_STATE (and unsetting DBT_DEFER_STATE), it works as expected, and the flag gets precedence. i.e. the used state is 'state'
Relevant log output
NA
Environment
- OS: Windows 11
- Python: 3.10.5
- dbt: 1.8.7
Which database adapter are you using with dbt?
spark
Additional Context
I noticed that the on-run-end DOES use the expected state (provided via the cli flags) when having DBT_DEFER_STATE set! Causing inconsistent catalogs being referred in my case.
The text was updated successfully, but these errors were encountered:
Hi @dbeatty10 ,
Thanks for your reply!
no, I didn't but I did expect the --defer and --state to overwrite also --defer-state when it has been set. It felt like one of those options was probably legacy, but maybe I am mistaken?
The second doc's link you shared I didn't check yet, so thanks for sharing! State seems to be used in two different contexts of which I am unfamiliar with the state:modified+ select syntax. But I dont understand (from a short read) from the docs how --defer-state differs from the combination --defer and --state, so that's why I would expect the latter two (as cli commands) to also overwrite the former as an env var.
As a sidenote, the behavior that I am sure is undesired is that the on-run-end uses one state while the dbt call uses another. See the last sentence of the bug report.
Is this a new bug in dbt-core?
Current Behavior
When specifying the env var DBT_DEFER_STATE=stateprod, it appears to be considered even when you try to overrule the state manually using
dbt test --defer --state state
(non-prod)Do I miss something regarding
Expected Behavior
Expected to be able to overwrite the state using the flags, as stated in the docs: https://docs.getdbt.com/reference/node-selection/syntax#establishing-state
Steps To Reproduce
The following example results in
stateprod
being used as state.When doing the same with DBT_STATE (and unsetting DBT_DEFER_STATE), it works as expected, and the flag gets precedence. i.e. the used state is 'state'
Relevant log output
Environment
Which database adapter are you using with dbt?
spark
Additional Context
I noticed that the on-run-end DOES use the expected state (provided via the cli flags) when having DBT_DEFER_STATE set! Causing inconsistent catalogs being referred in my case.
The text was updated successfully, but these errors were encountered: