diff --git a/python/pyspark/context.py b/python/pyspark/context.py index 4ec4646411c7b..acd6ca1d5e7a0 100644 --- a/python/pyspark/context.py +++ b/python/pyspark/context.py @@ -834,7 +834,7 @@ def addPyPackage(self, pkg): import pyspark import foolib - + sc = pyspark.SparkContext() sc.addPyPackage(foolib) # foolib now in workers PYTHONPATH diff --git a/python/pyspark/tests.py b/python/pyspark/tests.py index a6ba9f5cf257a..8c8070ba75112 100644 --- a/python/pyspark/tests.py +++ b/python/pyspark/tests.py @@ -1955,8 +1955,8 @@ def test_add_py_package(self): temp.write("triple = lambda x: 3*x") pkg = __import__(name) with SparkContext() as sc: - #trips = sc.parallelize([0, 1, 2, 3]).map(pkg.triple) - #sc.addPyPackage(pkg) + # trips = sc.parallelize([0, 1, 2, 3]).map(pkg.triple) + # sc.addPyPackage(pkg) trips = sc.parallelize([0, 1, 2, 3]).map(lambda x: pkg.triple(x)) self.assertSequenceEqual([0, 3, 6, 9], trips.collect()) finally: