티스토리 뷰
728x90
from datetime import datetime
from airflow.exceptions import AirflowSkipException
from airflow.models import DAG
from airflow.operators.dummy import DummyOperator
from airflow.operators.python import PythonOperator
with DAG(
dag_id="mydag",
start_date=datetime(2022, 1, 18),
schedule_interval="@once"
) as dag:
def task_b():
raise AirflowSkipException
A = DummyOperator(task_id="A")
B = PythonOperator(task_id="B", python_callable=task_b)
C = DummyOperator(task_id="C", trigger_rule="none_failed")
A >> B >> C
How to skip a task in airflow without skipping its downstream tasks?
Let’s say this is my dag: A >> B >> C If task B raises an exception, I want to skip the task instead of failing it. However, I don’t want to skip task C. I looked into AirflowSkipExcept...
stackoverflow.com
728x90
'공부' 카테고리의 다른 글
[docker] M1 MacOSX - no matching manifest for linux/arm64/v8 in the manifest list entries (0) | 2022.05.23 |
---|---|
[gradle] mavenCentral(), jCenter(), mavenLocal(), gradlePluginPortal() (0) | 2022.05.23 |
[Sh] array contains (0) | 2022.05.23 |
[Spring] kafka config (0) | 2022.05.22 |
[logback] kafka-appender (0) | 2022.05.22 |
댓글