[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bit confused about start_date and schedule_interval related to daily/weekly DAG

I'm a bit confused with how the scheduler catches up in relation to
start_date and schedule_interval. I have one dag that runs hourly:

dag = DAG(

When I start this DAG fresh it will catch up 24 hours + however many hours
have passed in the current day all the way up to the most recent hour. This
makes sense to me.

Now if I have a daily DAG:

dag = DAG(
    schedule_interval='0 5 * * *',

Starting this DAG fresh will run yesterday's execution. This is fine since
I use the execution_date (ds_nodash) to have the task be lagged by one day.
What I can't seem to wrap my head around is how I would get this DAG to run
for the current day. I've tried passing is days_ago(0) but the tasks never
seem to start?

In addition to all that, I have a weekly DAG that must also use the
execution_date, but it needs the current weeks execution_date.

*How do I get a DAG that is not hourly to have an execution_date of the
current day or week?*