spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject spark git commit: [SPARK-12960] [PYTHON] Some examples are missing support for python2
Date Fri, 22 Jan 2016 05:18:28 GMT
Repository: spark
Updated Branches:
  refs/heads/master 55c7dd031 -> 006906db5


[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.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/006906db
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/006906db
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/006906db

Branch: refs/heads/master
Commit: 006906db591666a7111066afd226325452be2e3e
Parents: 55c7dd0
Author: Mark Grover <mark@apache.org>
Authored: Thu Jan 21 21:17:36 2016 -0800
Committer: Davies Liu <davies.liu@gmail.com>
Committed: Thu Jan 21 21:17:36 2016 -0800

----------------------------------------------------------------------
 examples/src/main/python/streaming/direct_kafka_wordcount.py       | 1 +
 .../src/main/python/examples/streaming/kinesis_wordcount_asl.py    | 2 ++
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/006906db/examples/src/main/python/streaming/direct_kafka_wordcount.py
----------------------------------------------------------------------
diff --git a/examples/src/main/python/streaming/direct_kafka_wordcount.py b/examples/src/main/python/streaming/direct_kafka_wordcount.py
index ea20678..7097f7f 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
 

http://git-wip-us.apache.org/repos/asf/spark/blob/006906db/extras/kinesis-asl/src/main/python/examples/streaming/kinesis_wordcount_asl.py
----------------------------------------------------------------------
diff --git a/extras/kinesis-asl/src/main/python/examples/streaming/kinesis_wordcount_asl.py
b/extras/kinesis-asl/src/main/python/examples/streaming/kinesis_wordcount_asl.py
index f428f64..51f8c5c 100644
--- a/extras/kinesis-asl/src/main/python/examples/streaming/kinesis_wordcount_asl.py
+++ b/extras/kinesis-asl/src/main/python/examples/streaming/kinesis_wordcount_asl.py
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message