-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask_Group_Example.py
More file actions
26 lines (20 loc) · 835 Bytes
/
Task_Group_Example.py
File metadata and controls
26 lines (20 loc) · 835 Bytes
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
from airflow.models import DAG, Variable
from airflow.operators.bash import BashOperator
from datetime import date, datetime, timedelta
from airflow.operators.dummy_operator import DummyOperator
from task_group import training_groups
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2021, 8, 16),
'email': ['xxx@gmail.com'],
'email_on_failure': True,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=0.5)
}
with DAG('parent_dag', default_args=default_args, schedule_interval= '@daily', catchup=False) as dag:
start = BashOperator(task_id = "start", bash_command = "echo 'start'")
group_training_task = training_groups()
end = BashOperator(task_id = "end", bash_command = "echo 'end'")
start >> group_training_task >> end