diff options
author | Mark Grover <mark@apache.org> | 2016-01-21 21:17:36 -0800 |
---|---|---|
committer | Davies Liu <davies.liu@gmail.com> | 2016-01-21 21:17:36 -0800 |
commit | 006906db591666a7111066afd226325452be2e3e (patch) | |
tree | c2066217fe123dc1449f0154092b702a718ea6db /examples/src | |
parent | 55c7dd031b8a58976922e469626469aa4aff1391 (diff) | |
download | spark-006906db591666a7111066afd226325452be2e3e.tar.gz spark-006906db591666a7111066afd226325452be2e3e.tar.bz2 spark-006906db591666a7111066afd226325452be2e3e.zip |
[SPARK-12960] [PYTHON] Some examples are missing support for python2
Without importing the print_function, the lines later on like ```print("Usage: direct_kafka_wordcount.py <broker_list> <topic>", file=sys.stderr)``` fail when using python2.*. Import fixes that problem and doesn't break anything on python3 either.
Author: Mark Grover <mark@apache.org>
Closes #10872 from markgrover/python2_compat.
Diffstat (limited to 'examples/src')
-rw-r--r-- | examples/src/main/python/streaming/direct_kafka_wordcount.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/src/main/python/streaming/direct_kafka_wordcount.py b/examples/src/main/python/streaming/direct_kafka_wordcount.py index ea20678b9a..7097f7f450 100644 --- a/examples/src/main/python/streaming/direct_kafka_wordcount.py +++ b/examples/src/main/python/streaming/direct_kafka_wordcount.py @@ -28,6 +28,7 @@ examples/src/main/python/streaming/direct_kafka_wordcount.py \ localhost:9092 test` """ +from __future__ import print_function import sys |