Skip to content

Commit f89ac82

Browse files
TrevorEdwardstswast
authored andcommitted
Use logging on the PythonOperator in simple.py (#1663)
This allows Airflow to surface the 'Hello World!' output, as PythonOperator does not include STDOUT in its logs.
1 parent 96861aa commit f89ac82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

composer/workflows/simple.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
# [END composer_simple_define_dag]
4848
# [START composer_simple_operators]
4949
def greeting():
50-
print('Hello World!')
50+
import logging
51+
logging.info('Hello World!')
5152

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

0 commit comments

Comments
 (0)