-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.py
36 lines (29 loc) · 955 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import sys
import logging
from os import path
from datetime import datetime, timedelta
import sys
from airflow.decorators import dag, task
from airflow.operators.bash_operator import BashOperator
from airflow.models.param import Param
sys.path.append(path.dirname(path.realpath(__file__)))
from tasks.alerting import send_alert_discord
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
ARGS = {
'owner': 'apentori',
'depends_on_past': False,
'start_date': datetime(2024,12,2),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 0,
'retry_delay': timedelta(minutes=10),
'on_failure_callback': send_alert_discord,
}
@dag('test_stuff', params={ "model": Param("command", type="string")}, default_args=ARGS, schedule_interval=None)
def test_stuff():
BashOperator(
task_id = 'test-alerting',
bash_command='{{ params.model }}'
)
test_stuff()