问题
I have 3 tasks, A, B and C. I want to run task A only once, and then run task B monthly until end_date, then run task C only once to clean up.
This is similar to this question, but not applicable. How to handle different task intervals on a single Dag in airflow?
Thanks for your help
回答1:
For task A that is supposed to run only once, you can take inspiration from here
As far as tasks B & C are concerned, they can be tied up with A using a ShortCircuitOperator
(as already told in the link you cited)
-> B
/
A -> ShortCircuit
\
-> C
Alternatively, you could skip B and C internally using an AirflowSkipException
来源:https://stackoverflow.com/questions/57060047/run-dag-with-tasks-of-different-interval