I have use case to create 2 tasks of BigqueryOperator that have same destination table but I need one to run daily, and the second one to be run manually just when I need.
Below are the illustration of Tree View
| task_3rd_adhoc
| task_3rd
|---- task_2nd
|---- task_1st_a
|---- task_1st_b
From example above, DAG are run daily. And I aim to the task will be:
- task_1st_a and task_1st_b run first. Target table are:
- project.dataset.table_1st_a with _PARTITIONTIME = execution date, and
- project.dataset.table_1st_b with _PARTITIONTIME = execution date.
- then task_2nd_a will run after task_1st_a and task_1st_b finish. BigQueryOperator use TriggerRule.ALL_SUCCESS. Target table is:
- project.dataset.table_2nd with _PARTITIONTIME = execution date.
- then task_3rd will run after task_2nd success. BigQueryOperator use TriggerRule.ALL_SUCCESS. Target table is:
- project.dataset.table_3rd with PARTITIONTIME = D-2 from execution date.
- task_3rd_adhoc will not run in daily job. I need this when I want to backfill table project.dataset.table_3rd. With target table:
- project.dataset.table_3rd with _PARTITIONTIME = execution_date
But I still can't find what is the correct TriggerRule for step #4 above. I tried TriggerRule.DUMMY because I thought it can be used to set no Trigger, but task_3rd_adhoc also run in daily job when I tried create DAG above. (based on this doc dependencies are just for show, trigger at will)