ds_user
ds_user

Reputation: 2179

airflow schedule_interval not working

I have my DAG like this,

dag = DAG('testing',description='Testing DAG',schedule_interval='0 4,15 * * *')

t1 = BashOperator(task_id = 'testing_task',bash_command = 'python /home/ubuntu/airflow/dags/scripts/test.py',dag=dag, start_date=datetime(2018, 2, 8))

I want to schedule it to run every day 3PM and 4AM, I changed my AWS instance local timezone to NZ.

In the airflow web UI, in the top right, i still see airflow showing UTC time. However if i see the last run(my manual run through UI) for my DAG, it shows NZ time. So i assumed the schedular works in local timezone (NZ time), so tried to schedule on that timezone, but it was not triggered on time. Job did not work on time. How to solve this?

Thanks,

Upvotes: 1

Views: 1731

Answers (1)

Ash Berlin-Taylor
Ash Berlin-Taylor

Reputation: 4048

Right now (as of Airflow 1.9) Airflow only operates in UTC. The "solution" for now is to put the schedule in UTC -- as horrible as that is.

The good news is that on the master branch (which will be in the next non-point release, Airflow 1.10) is support for Timezones! https://github.com/apache/incubator-airflow/blob/772dbae298680feb9d521e7cd5526f4059d7cb69/docs/timezone.rst

Upvotes: 3

Related Questions