I'm trying to pass Airflow logical_date to dbt model so that I can use it in the model (sql). I'm using Airflow 2.11.0. I'm doing below, but the dag couldn't get constructed, with an error says:
'logical_date' is undefined.
However it works if I remove the in_timezone conversion.
How should I do this? It works in earlier version of Airflow. Thanks.
dbt_task = DbtTaskGroup (
select = ["mymodel"]
operator_args{
"vars": {
"logical_date_to_use_in_model" : "{{logical_date.in_timezone('America/Vancouver')}}"
},
},
)
print(logical_date.in_timezone('America/Vancouver'))