1

I have created a couple of DAGs, almost identical, just to test scheduling. Created the DAG files on 21 June 2023, at 1:22 and 1:57 AM (night, local time in Ukraine). Their start times: start_date = datetime(2023, 6, 21, 10, 0, 0) and start_date = datetime(2023, 6, 21, 9, 30, 0) and schedule_interval = '@daily' for both.

So, they should run on 22 June 2023 at 10:00 AM and 9:30 AM, that is start_date + schedule_interval.

Now is 22 June 2023, 14:20 (local time), none of these DAGS has started.

The "Next run" in the UI shows 2023-06-22 00:00:00 (this is wrong anyway).

I use a docker-compose example from a course on Udemy to launch AirFlow in Docker, and the version of AirFlow is 2.4.2 (I know, this is not the last one).

Did I miss something, am I unaware of something, or Airflow scheduling does not work at all? a screenshot

user3791111
  • 1,469
  • 1
  • 15
  • 20

1 Answers1

1

The @daily schedule interval is always for midnight, that's why you see the "next dag run" at midnight

In order to set the required run hour, you need to provide a "cron" like expression instead of @daily

for example:

  • Run at 10AM - 0 10 * * *
  • Run at 9:30AM - 30 9 * * *
Saar Levy
  • 330
  • 2
  • 6
  • +1 for @saar-levy answer. For more details, your DAG will run at start_date + schedule_interval. So, if you set the start_date as datetime(2023, 6, 21, 10, 0, 0) and the schedule_interval as '@daily', it will run at datetime(2023, 6, 22, 0, 0, 0). – enchant3dmango Jun 23 '23 at 05:22