Conform the tutorial to the code at the beginning
This commit is contained in:
Родитель
9210c1b76c
Коммит
8d14b6629f
|
@ -94,13 +94,20 @@ of default parameters that we can use when creating tasks.
|
|||
|
||||
from datetime import datetime
|
||||
|
||||
args = {
|
||||
default_args = {
|
||||
'owner': 'airflow',
|
||||
'depends_on_past': False,
|
||||
'start_date': datetime(2015, 1, 1),
|
||||
'email': ['airflow@airflow.com',],
|
||||
'email_on_failure': True,
|
||||
'email_on_retry': True,
|
||||
'start_date': datetime(2015, 6, 1),
|
||||
'email': ['airflow@airflow.com'],
|
||||
'email_on_failure': False,
|
||||
'email_on_retry': False,
|
||||
'retries': 1,
|
||||
'retry_interval': timedelta(minutes=5),
|
||||
# 'queue': 'bash_queue',
|
||||
# 'pool': 'backfill',
|
||||
# 'priority_weight': 10,
|
||||
# 'schedule_interval': timedelta(1),
|
||||
# 'end_date': datetime(2016, 1, 1),
|
||||
}
|
||||
|
||||
For more information about the BaseOperator's parameters and what they do,
|
||||
|
@ -137,7 +144,6 @@ instantiated from an operator is called a constructor. The first argument
|
|||
|
||||
t2 = BashOperator(
|
||||
task_id='sleep',
|
||||
email_on_failure=False,
|
||||
bash_command='sleep 5',
|
||||
dag=dag)
|
||||
|
||||
|
@ -241,20 +247,28 @@ something like this:
|
|||
"""
|
||||
from airflow import DAG
|
||||
from airflow.operators import BashOperator
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
||||
default_args = {
|
||||
'owner': 'airflow',
|
||||
'depends_on_past': False,
|
||||
'start_date': datetime(2015, 1, 1),
|
||||
'start_date': datetime(2015, 6, 1),
|
||||
'email': ['airflow@airflow.com'],
|
||||
'email_on_failure': False,
|
||||
'email_on_retry': False,
|
||||
'retries': 1,
|
||||
'retry_interval': timedelta(minutes=5),
|
||||
# 'queue': 'bash_queue',
|
||||
# 'pool': 'backfill',
|
||||
# 'priority_weight': 10,
|
||||
# 'schedule_interval': timedelta(1),
|
||||
# 'end_date': datetime(2016, 1, 1),
|
||||
}
|
||||
|
||||
dag = DAG('tutorial', default_args=default_args)
|
||||
|
||||
# t1, t2 and t3 are examples of tasks created by instatiating operators
|
||||
t1 = BashOperator(
|
||||
task_id='print_date',
|
||||
bash_command='date',
|
||||
|
@ -262,7 +276,6 @@ something like this:
|
|||
|
||||
t2 = BashOperator(
|
||||
task_id='sleep',
|
||||
email_on_failure=False,
|
||||
bash_command='sleep 5',
|
||||
dag=dag)
|
||||
|
||||
|
@ -277,7 +290,7 @@ something like this:
|
|||
t3 = BashOperator(
|
||||
task_id='templated',
|
||||
bash_command=templated_command,
|
||||
params={'my_param': 'Parameter I passed in'},
|
||||
params={'my_param': 'Paramater I passed in'},
|
||||
dag=dag)
|
||||
|
||||
t2.set_upstream(t1)
|
||||
|
|
Загрузка…
Ссылка в новой задаче