I have airflow set up and running with some DAGs scheduled for once a day "0 0 * * *".
I want to check when is the next time a specific dag has been scheduled to run, but I can't see where I can do that within the admin.
Airflow scans the dags_folder for new DAGs every dag_dir_list_interval , which defaults to 5 minutes but can be modified. You might have to wait until this interval has passed before a new DAG appears in the UI.
As Airflow has its scheduler and it adopts the schedule interval syntax from cron, the smallest data and time interval in the Airflow scheduler world is minute. Inside of the scheduler, the only thing that is continuously running is the scheduler itself.
To schedule a dag, Airflow just looks for the last execution date and sum the schedule interval . If this time has expired it will run the dag. You cannot simple update the start date. A simple way to do this is edit your start date and schedule interval , rename your dag (e.g. xxxx_v2.py) and redeploy it.
If you want to see that programmatically (tested with Airflow v2.2.4):
info = dag.next_dagrun_info(None)
info.run_after # datetime.datetime(2022, 3, 9, 22, 0, tzinfo=Timezone('UTC'))
you can also have:
info.logical_date # datetime.datetime(2022, 3, 8, 22, 0, tzinfo=Timezone('UTC'))
info.data_interval # DataInterval(start=datetime.datetime(2022, 3, 8, 22, ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With