aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/profiler.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/pyspark/profiler.py')
-rw-r--r--python/pyspark/profiler.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/pyspark/profiler.py b/python/pyspark/profiler.py
index 4408996db0..d18daaabfc 100644
--- a/python/pyspark/profiler.py
+++ b/python/pyspark/profiler.py
@@ -84,11 +84,11 @@ class Profiler(object):
>>> from pyspark import BasicProfiler
>>> class MyCustomProfiler(BasicProfiler):
... def show(self, id):
- ... print "My custom profiles for RDD:%s" % id
+ ... print("My custom profiles for RDD:%s" % id)
...
>>> conf = SparkConf().set("spark.python.profile", "true")
>>> sc = SparkContext('local', 'test', conf=conf, profiler_cls=MyCustomProfiler)
- >>> sc.parallelize(list(range(1000))).map(lambda x: 2 * x).take(10)
+ >>> sc.parallelize(range(1000)).map(lambda x: 2 * x).take(10)
[0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
>>> sc.show_profiles()
My custom profiles for RDD:1
@@ -111,9 +111,9 @@ class Profiler(object):
""" Print the profile stats to stdout, id is the RDD id """
stats = self.stats()
if stats:
- print "=" * 60
- print "Profile of RDD<id=%d>" % id
- print "=" * 60
+ print("=" * 60)
+ print("Profile of RDD<id=%d>" % id)
+ print("=" * 60)
stats.sort_stats("time", "cumulative").print_stats()
def dump(self, id, path):