Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
pep8ing
  • Loading branch information
buck heroux committed May 13, 2016
commit 9c37e0649a75d22d5712b08dcd6c3acee412f719
2 changes: 1 addition & 1 deletion python/pyspark/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ def addPyPackage(self, pkg):

import pyspark
import foolib

sc = pyspark.SparkContext()
sc.addPyPackage(foolib)
# foolib now in workers PYTHONPATH
Expand Down
4 changes: 2 additions & 2 deletions python/pyspark/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down