Real Sequential Dynamic Task #44789
Replies: 3 comments 5 replies
-
This is similar thing to recent discussion by @dabla https://lists.apache.org/thread/bx2w6dpr3ynvnq06n4v62n7g8dodt2rt -> and while it is even yet different use case, it can (again) be solved via similar means. I think @dabla was going to propose an Airflow Improvement Proposal so maybe good idea to discuss it there. |
Beta Was this translation helpful? Give feedback.
-
Hi all, thanks for the quick answer. To sum it up, it means that it is not possible at the moment? Please correct me if I'm wrong. Thanks |
Beta Was this translation helpful? Give feedback.
-
To close this discussion, I will put my workaround for now, at least it will prevent subsequent map task (next index) to run when the previous map task (previous index) failed or retrying. Because in my case, running the subsequent task before the previous one succeed will break the data. Basically, in my run_dbt_snapshot method that will be expanded, I will raise an AirflowSkipException('Some error messages') if some condition is not met. In my case by checking my log table of the dates that has successfully run. |
Beta Was this translation helpful? Give feedback.
-
I wanted to generate a dynamic tasks using expand based on a range of date. I am able to do that, but it seems the tasks is running in parallel. I wanted it to run in sequential, by waiting for the previous tasks to succeed.
I am able to limit the task to run only 1 at a time by setting max_active_tasks=1, max_active_runs=1, and max_active_tis_per_dag=1. But the issue is when one of the task failed or is retrying, it will still trigger the next task. This is not the behaviour that I wanted. Let me give an illustration:
Current behaviour:
Run 8 Nov (Success) -> Run 9 Nov (Retry) -> Run 10 Nov (In Progress)
Run 8 Nov (Success) -> Run 9 Nov (Failed) -> Run 10 Nov (In Progress)
Expected behaviour:
Run 8 Nov (Success) -> Run 9 Nov (Retry) -> Run 10 Nov (Scheduled)
Run 8 Nov (Success) -> Run 9 Nov (Failed) -> Run 10 Nov (Failed)
The error occured on 9 Nov
This is a part of my code:
Beta Was this translation helpful? Give feedback.
All reactions