Can you have a DAG dependent on another DAG?
I see airflow.operators.ExternalTaskSensor supports dependency on an ask in another DAG. But is it possible to set dependency on another DAG itself? In other words, can external_task_id parameter be optional?
Not for now but it'd be easy to either write an ExternalDagSensor, or add a DummyOperator to the DAG you want to depend on that would be downstream of all the tasks, and use the ExternalTaskSensor against it.
Thanks @mistercrunch . I think DummyOperator should be an easy solution.
Should I close this?
Yup, closing.
@mistercrunch sorry to hijack this thread but I've been using the DummyOperator approach for a couple Dags and was considering writing an ExternalDagSensor. Would you accept a PR for one? My thought was it would be identical to ExternalTaskSensor except instead of looking at just one task it would look at every task in the DAG (which it would retrieve from the ORM).
@jlowin , ExternalDagSensor sounds good, check out the DAG's root property to get all tasks without downstream deps.
I like for everything in a DAG to converge to a last point (an email operator + slack operator that post about completion) but I can understand that not everyone build their DAGs that way.