Skip to content
Snippets Groups Projects
Commit 006906db authored by Mark Grover's avatar Mark Grover Committed by Davies Liu
Browse files

[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.
parent 55c7dd03
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@
examples/src/main/python/streaming/direct_kafka_wordcount.py \
localhost:9092 test`
"""
from __future__ import print_function
import sys
......
......@@ -54,6 +54,8 @@
See http://spark.apache.org/docs/latest/streaming-kinesis-integration.html for more details on
the Kinesis Spark Streaming integration.
"""
from __future__ import print_function
import sys
from pyspark import SparkContext
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment