Skip to content

composer: add region tags to simple dag example #1473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions composer/workflows/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@
# [START composer_simple]
from __future__ import print_function

# [START composer_simple_define_dag]
import datetime

from airflow import models
# [END composer_simple_define_dag]
# [START composer_simple_operators]
from airflow.operators import bash_operator
from airflow.operators import python_operator
# [END composer_simple_operators]


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

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

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