|
1 | 1 | from typing import List |
2 | 2 |
|
3 | | -from airflow.operators.python import BranchPythonOperator, PythonOperator |
4 | 3 | from airflow.decorators import dag |
| 4 | +from airflow.operators.python import BranchPythonOperator, PythonOperator |
5 | 5 | from airflow.utils.trigger_rule import TriggerRule |
6 | 6 |
|
7 | 7 | from dags import DEFAULT_DAG_ARGUMENTS, NOTICE_NORMALISATION_PIPELINE_TASK_ID, STOP_PROCESSING_TASK_ID, \ |
8 | 8 | BRANCH_SELECTOR_MAP, NOTICE_TRANSFORMATION_PIPELINE_TASK_ID, NOTICE_VALIDATION_PIPELINE_TASK_ID, \ |
9 | 9 | NOTICE_PACKAGE_PIPELINE_TASK_ID, NOTICE_PUBLISH_PIPELINE_TASK_ID, BRANCH_SELECTOR_TASK_ID, \ |
10 | 10 | SELECTOR_BRANCH_BEFORE_TRANSFORMATION_TASK_ID, SELECTOR_BRANCH_BEFORE_VALIDATION_TASK_ID, \ |
11 | | - SELECTOR_BRANCH_BEFORE_PACKAGE_TASK_ID, SELECTOR_BRANCH_BEFORE_PUBLISH_TASK_ID, NOTICE_DISTILLATION_PIPELINE_TASK_ID |
| 11 | + SELECTOR_BRANCH_BEFORE_PACKAGE_TASK_ID, SELECTOR_BRANCH_BEFORE_PUBLISH_TASK_ID, \ |
| 12 | + NOTICE_DISTILLATION_PIPELINE_TASK_ID, NOTICES_COLLECTION_DATASET |
12 | 13 | from dags.dags_utils import get_dag_param, smart_xcom_push, smart_xcom_forward, smart_xcom_pull |
13 | 14 | from dags.operators.DagBatchPipelineOperator import NoticeBatchPipelineOperator, NOTICE_IDS_KEY, \ |
14 | 15 | EXECUTE_ONLY_ONE_STEP_KEY, START_WITH_STEP_NAME_KEY |
|
18 | 19 |
|
19 | 20 | DAG_NAME = "notice_processing_pipeline" |
20 | 21 |
|
| 22 | + |
21 | 23 | def branch_selector(result_branch: str, xcom_forward_keys: List[str] = [NOTICE_IDS_KEY]) -> str: |
22 | 24 | start_with_step_name = get_dag_param(key=START_WITH_STEP_NAME_KEY, |
23 | 25 | default_value=NOTICE_NORMALISATION_PIPELINE_TASK_ID) |
@@ -95,7 +97,8 @@ def _stop_processing(): |
95 | 97 | stop_processing = PythonOperator( |
96 | 98 | task_id=STOP_PROCESSING_TASK_ID, |
97 | 99 | trigger_rule=TriggerRule.NONE_FAILED_MIN_ONE_SUCCESS, |
98 | | - python_callable=_stop_processing |
| 100 | + python_callable=_stop_processing, |
| 101 | + outlets=NOTICES_COLLECTION_DATASET |
99 | 102 | ) |
100 | 103 |
|
101 | 104 | notice_normalisation_step = NoticeBatchPipelineOperator(notice_pipeline_callable=notice_normalisation_pipeline, |
|
0 commit comments