11from typing import List
22
33from airflow .decorators import dag
4+ from airflow .exceptions import AirflowSkipException
45from airflow .operators .python import BranchPythonOperator , PythonOperator
56from airflow .utils .trigger_rule import TriggerRule
67
@@ -61,37 +62,36 @@ def _selector_branch_before_publish():
6162 return branch_selector (NOTICE_PUBLISH_PIPELINE_TASK_ID )
6263
6364 def _stop_processing ():
64- notice_ids = smart_xcom_pull (key = NOTICE_IDS_KEY )
65- if not notice_ids :
66- raise Exception (f"No notice has been processed!" )
65+ pass
6766
6867 start_processing = BranchPythonOperator (
6968 task_id = BRANCH_SELECTOR_TASK_ID ,
7069 python_callable = _start_processing ,
70+ trigger_rule = TriggerRule .ALWAYS
7171 )
7272
7373 selector_branch_before_transformation = BranchPythonOperator (
7474 task_id = SELECTOR_BRANCH_BEFORE_TRANSFORMATION_TASK_ID ,
7575 python_callable = _selector_branch_before_transformation ,
76- trigger_rule = TriggerRule .NONE_FAILED_MIN_ONE_SUCCESS ,
76+ trigger_rule = TriggerRule .ALL_SUCCESS ,
7777 )
7878
7979 selector_branch_before_validation = BranchPythonOperator (
8080 task_id = SELECTOR_BRANCH_BEFORE_VALIDATION_TASK_ID ,
8181 python_callable = _selector_branch_before_validation ,
82- trigger_rule = TriggerRule .NONE_FAILED_MIN_ONE_SUCCESS ,
82+ trigger_rule = TriggerRule .ALL_SUCCESS ,
8383 )
8484
8585 selector_branch_before_package = BranchPythonOperator (
8686 task_id = SELECTOR_BRANCH_BEFORE_PACKAGE_TASK_ID ,
8787 python_callable = _selector_branch_before_package ,
88- trigger_rule = TriggerRule .NONE_FAILED_MIN_ONE_SUCCESS ,
88+ trigger_rule = TriggerRule .ALL_SUCCESS ,
8989 )
9090
9191 selector_branch_before_publish = BranchPythonOperator (
9292 task_id = SELECTOR_BRANCH_BEFORE_PUBLISH_TASK_ID ,
9393 python_callable = _selector_branch_before_publish ,
94- trigger_rule = TriggerRule .NONE_FAILED_MIN_ONE_SUCCESS ,
94+ trigger_rule = TriggerRule .ALL_SUCCESS ,
9595 )
9696
9797 stop_processing = PythonOperator (
@@ -103,27 +103,27 @@ def _stop_processing():
103103
104104 notice_normalisation_step = NoticeBatchPipelineOperator (notice_pipeline_callable = notice_normalisation_pipeline ,
105105 task_id = NOTICE_NORMALISATION_PIPELINE_TASK_ID ,
106- trigger_rule = TriggerRule .NONE_FAILED_MIN_ONE_SUCCESS )
106+ trigger_rule = TriggerRule .ALL_SUCCESS )
107107
108108 notice_transformation_step = NoticeBatchPipelineOperator (notice_pipeline_callable = notice_transformation_pipeline ,
109109 task_id = NOTICE_TRANSFORMATION_PIPELINE_TASK_ID ,
110- trigger_rule = TriggerRule .NONE_FAILED_MIN_ONE_SUCCESS )
110+ trigger_rule = TriggerRule .ALL_SUCCESS )
111111
112112 notice_distillation_step = NoticeBatchPipelineOperator (batch_pipeline_callable = notices_batch_distillation_pipeline ,
113113 task_id = NOTICE_DISTILLATION_PIPELINE_TASK_ID ,
114- trigger_rule = TriggerRule .NONE_FAILED_MIN_ONE_SUCCESS
114+ trigger_rule = TriggerRule .ALL_SUCCESS
115115 )
116116
117117 notice_validation_step = NoticeBatchPipelineOperator (notice_pipeline_callable = notice_validation_pipeline ,
118118 task_id = NOTICE_VALIDATION_PIPELINE_TASK_ID ,
119- trigger_rule = TriggerRule .NONE_FAILED_MIN_ONE_SUCCESS )
119+ trigger_rule = TriggerRule .ALL_SUCCESS )
120120 notice_package_step = NoticeBatchPipelineOperator (notice_pipeline_callable = notice_package_pipeline ,
121121 task_id = NOTICE_PACKAGE_PIPELINE_TASK_ID ,
122- trigger_rule = TriggerRule .NONE_FAILED_MIN_ONE_SUCCESS )
122+ trigger_rule = TriggerRule .ALL_SUCCESS )
123123
124124 notice_publish_step = NoticeBatchPipelineOperator (notice_pipeline_callable = notice_publish_pipeline ,
125125 task_id = NOTICE_PUBLISH_PIPELINE_TASK_ID ,
126- trigger_rule = TriggerRule .NONE_FAILED_MIN_ONE_SUCCESS )
126+ trigger_rule = TriggerRule .ALL_SUCCESS )
127127
128128 start_processing >> [notice_normalisation_step , selector_branch_before_transformation ,
129129 selector_branch_before_validation ,
0 commit comments