Skip to content

Commit

Permalink
Use logging on the PythonOperator in simple.py (#1663)
Browse files Browse the repository at this point in the history
This allows Airflow to surface the 'Hello World!' output, as PythonOperator does not include STDOUT in its logs.
  • Loading branch information
TrevorEdwards authored and tswast committed Aug 29, 2018
1 parent 96861aa commit f89ac82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer/workflows/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
# [END composer_simple_define_dag]
# [START composer_simple_operators]
def greeting():
print('Hello World!')
import logging
logging.info('Hello World!')

# An instance of an operator is called a task. In this case, the
# hello_python task calls the "greeting" Python function.
Expand Down

0 comments on commit f89ac82

Please sign in to comment.