The problem I’m having
After deploying dbt models to Airflow, I don’t know how to pass the variable value from airflow to dbt.
The context of why I’m trying to do this
I’m trying to do different grants based on what env I’m deploying to. I want to assign to the same role if deploying to dev or test env, and don’t assign any roles if deploying to prod.
Some example code or error messages
This is what I have in the dbt_project.yml
file.
+grants:
select: "{{ ['dev_and_test_role'] if env_var('DBT_ENVIRONMENT') in ['dev', 'test'] else []}}"
But I don’t know where do I set the DBT_ENVIRONMENT
value in airflow so that it can be passed down to the yml file.