오지's blog

airflow에서 timezone 변경 본문

개발노트/airflow

airflow에서 timezone 변경

잡스러운노트, 잡스노트 2023. 1. 27. 16:21
728x90
반응형
dag_run.logical_date.astimezone(dag.timezone)

 

 

date_check = PythonOperator(task_id="date_check", python_callable=date_check,dag=dag, op_kwargs={'table_name':'marketing', 'date':'{{dag_run.logical_date.astimezone(dag.timezone) | prev_ds_nodash}}'})

 

 

References

https://stackoverflow.com/questions/70924756/airflow-wrong-execution-date-for-timezone-aware-dags

 

Airflow wrong execution_date for timezone aware DAGs

We're using Airflow v2.2.3 on Kubernetes (KubernetesExecutor), our environment requires a DAG pre-customer, and each customer can be in a different timezone. Each DAG should be scheduled in its own

stackoverflow.com