File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 17
17
# [START composer_simple]
18
18
from __future__ import print_function
19
19
20
+ # [START composer_simple_define_dag]
20
21
import datetime
21
22
22
23
from airflow import models
24
+ # [END composer_simple_define_dag]
25
+ # [START composer_simple_operators]
23
26
from airflow .operators import bash_operator
24
27
from airflow .operators import python_operator
28
+ # [END composer_simple_operators]
25
29
26
30
31
+ # [START composer_simple_define_dag]
27
32
default_dag_args = {
28
33
# The start_date describes when a DAG is valid / can be run. Set this to a
29
34
# fixed point in time rather than dynamically, since it is evaluated every
38
43
with models .DAG (
39
44
'simple_greeting' ,
40
45
default_args = default_dag_args ) as dag :
46
+ # [END composer_simple_define_dag]
47
+ # [START composer_simple_operators]
41
48
def greeting ():
42
49
print ('Hello World!' )
43
50
@@ -51,8 +58,11 @@ def greeting():
51
58
goodbye_bash = bash_operator .BashOperator (
52
59
task_id = 'bye' ,
53
60
bash_command = 'echo Goodbye.' )
61
+ # [END composer_simple_operators]
54
62
63
+ # [START composer_simple_relationships]
55
64
# Define the order in which the tasks complete by using the >> and <<
56
65
# operators. In this example, hello_python executes before goodbye_bash.
57
66
hello_python >> goodbye_bash
67
+ # [END composer_simple_relationships]
58
68
# [END composer_simple]
You can’t perform that action at this time.
0 commit comments