新增告警
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
from airflow import DAG
|
||||||
|
from airflow.operators.python_operator import PythonOperator
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
def fail_task():
|
||||||
|
raise ValueError("This task is designed to fail")
|
||||||
|
|
||||||
|
dag = DAG(
|
||||||
|
'test_failure_notification',
|
||||||
|
start_date=datetime(2025, 4, 22),
|
||||||
|
schedule_interval=None
|
||||||
|
)
|
||||||
|
|
||||||
|
task = PythonOperator(
|
||||||
|
task_id='failing_task',
|
||||||
|
python_callable=fail_task,
|
||||||
|
dag=dag
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user