Skip to content

Commit 4987e3c

Browse files
authored
composer: add region tags to simple dag example (GoogleCloudPlatform#1473)
1 parent 62b0ddd commit 4987e3c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

composer/workflows/simple.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@
1717
# [START composer_simple]
1818
from __future__ import print_function
1919

20+
# [START composer_simple_define_dag]
2021
import datetime
2122

2223
from airflow import models
24+
# [END composer_simple_define_dag]
25+
# [START composer_simple_operators]
2326
from airflow.operators import bash_operator
2427
from airflow.operators import python_operator
28+
# [END composer_simple_operators]
2529

2630

31+
# [START composer_simple_define_dag]
2732
default_dag_args = {
2833
# The start_date describes when a DAG is valid / can be run. Set this to a
2934
# fixed point in time rather than dynamically, since it is evaluated every
@@ -38,6 +43,8 @@
3843
with models.DAG(
3944
'simple_greeting',
4045
default_args=default_dag_args) as dag:
46+
# [END composer_simple_define_dag]
47+
# [START composer_simple_operators]
4148
def greeting():
4249
print('Hello World!')
4350

@@ -51,8 +58,11 @@ def greeting():
5158
goodbye_bash = bash_operator.BashOperator(
5259
task_id='bye',
5360
bash_command='echo Goodbye.')
61+
# [END composer_simple_operators]
5462

63+
# [START composer_simple_relationships]
5564
# Define the order in which the tasks complete by using the >> and <<
5665
# operators. In this example, hello_python executes before goodbye_bash.
5766
hello_python >> goodbye_bash
67+
# [END composer_simple_relationships]
5868
# [END composer_simple]

0 commit comments

Comments
 (0)