dbt_constraints
dbt_constraints copied to clipboard
Conditional argument not accepted for dbt_constraints_enabled var
When we want to use conditional logic for dbt_constraints_enabled var it simply doesn't work.
When used the classic way, it works eg.
vars: dbt_constraints_enabled: true (or false)
But when I pass some conditions, it doesn't work - it gets build just like if dbt_constraints were enabled (true)
This is my config:
vars: dbt_constraints_enabled: {%- if target.name in ['dev_airflow','dev_local'] -%} false {%- else -%} true {%- endif -%}
I tried it on different projects (also clean version of jaffle_shop from dbt) but it didn't help, I started thinking it's not the issue of the config and conditional if else statement, but the package itself, I'd be glad if you could look into it.
I'm also including Stackoverflow question for more context.