eladkal edited a comment on issue #17585:
URL: https://github.com/apache/airflow/issues/17585#issuecomment-902014936
> Add another task with depends_on_past=True to the existing DAG
I think the issue here is that you assume that when you add a new task
Airflow knows that it starts from the date you added it thus you expect
`depends_on_past=True` to work but this is not the case. You must provide a
`start_date` to this new task for the `depends_on_past` to work.
```
from airflow import DAG
from airflow.operators.dummy import DummyOperator
from datetime import datetime
default_args = {
'owner': 'Elad',
'start_date': datetime(2021, 8, 19),
}
with DAG('my_dag2', default_args=default_args, schedule_interval='*/5 * * *
*') as dag:
a = DummyOperator(task_id="1st")
b = DummyOperator(task_id="2nd", wait_for_downstream=True)
a >> b
with DAG('my_dag3', default_args=default_args, schedule_interval='*/5 * * *
*') as dag:
a = DummyOperator(task_id="1st")
b = DummyOperator(task_id="2nd", wait_for_downstream=True,
start_date=datetime(2021, 8, 19, 15, 15))
a >> b
```
as you can see `my_dag3` works fine yet `my_dag2` is stuck:


--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]