Skip to content

Commit 0e0245f

Browse files
committed
[SPARK-2627] undo erroneous whitespace fixes
1 parent bf30942 commit 0e0245f

File tree

3 files changed

+24
-28
lines changed

3 files changed

+24
-28
lines changed

python/pyspark/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class SparkContext(object):
5959
_writeToFile = None
6060
_next_accum_id = 0
6161
_active_spark_context = None
62-
_lock = Lock() # zip and egg files that need to be added to PYTHONPATH
63-
_python_includes = None
62+
_lock = Lock()
63+
_python_includes = None # zip and egg files that need to be added to PYTHONPATH
6464
_default_batch_size_for_serialized_input = 10
6565

6666
def __init__(self, master=None, appName=None, sparkHome=None, pyFiles=None,

python/pyspark/tests.py

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,7 @@ def test_sequencefiles(self):
539539

540540
ed = [(1.0, u'aa'), (1.0, u'aa'), (2.0, u'aa'), (2.0, u'bb'), (2.0, u'bb'), (3.0, u'cc')]
541541
self.sc.parallelize(ed).saveAsSequenceFile(basepath + "/sfdouble/")
542-
doubles = sorted(
543-
self.sc.sequenceFile(basepath + "/sfdouble/").collect())
542+
doubles = sorted(self.sc.sequenceFile(basepath + "/sfdouble/").collect())
544543
self.assertEqual(doubles, ed)
545544

546545
ebs = [(1, bytearray(b'\x00\x07spam\x08')), (2, bytearray(b'\x00\x07spam\x08'))]
@@ -725,25 +724,25 @@ def test_unbatched_save_and_read(self):
725724
self.sc.parallelize(ei, numSlices=len(ei)).saveAsSequenceFile(
726725
basepath + "/unbatched/")
727726

728-
unbatched_sequence = sorted(self.sc.sequenceFile(basepath + "/unbatched/",
729-
batchSize=1).collect())
727+
unbatched_sequence = sorted(self.sc.sequenceFile(
728+
basepath + "/unbatched/",
729+
batchSize=1).collect())
730730
self.assertEqual(unbatched_sequence, ei)
731731

732-
unbatched_hadoopFile = sorted(
733-
self.sc.hadoopFile(basepath + "/unbatched/",
734-
"org.apache.hadoop.mapred.SequenceFileInputFormat",
735-
"org.apache.hadoop.io.IntWritable",
736-
"org.apache.hadoop.io.Text",
737-
batchSize=1).collect())
732+
unbatched_hadoopFile = sorted(self.sc.hadoopFile(
733+
basepath + "/unbatched/",
734+
"org.apache.hadoop.mapred.SequenceFileInputFormat",
735+
"org.apache.hadoop.io.IntWritable",
736+
"org.apache.hadoop.io.Text",
737+
batchSize=1).collect())
738738
self.assertEqual(unbatched_hadoopFile, ei)
739739

740-
unbatched_newAPIHadoopFile = sorted(
741-
self.sc.newAPIHadoopFile(
742-
basepath + "/unbatched/",
743-
"org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat",
744-
"org.apache.hadoop.io.IntWritable",
745-
"org.apache.hadoop.io.Text",
746-
batchSize=1).collect())
740+
unbatched_newAPIHadoopFile = sorted(self.sc.newAPIHadoopFile(
741+
basepath + "/unbatched/",
742+
"org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat",
743+
"org.apache.hadoop.io.IntWritable",
744+
"org.apache.hadoop.io.Text",
745+
batchSize=1).collect())
747746
self.assertEqual(unbatched_newAPIHadoopFile, ei)
748747

749748
oldconf = {"mapred.input.dir": basepath + "/unbatched/"}
@@ -949,9 +948,8 @@ def test_module_dependency(self):
949948
|def myfunc(x):
950949
| return x + 1
951950
""")
952-
proc = subprocess.Popen(
953-
[self.sparkSubmit, "--py-files", zip, script],
954-
stdout=subprocess.PIPE)
951+
proc = subprocess.Popen([self.sparkSubmit, "--py-files", zip, script],
952+
stdout=subprocess.PIPE)
955953
out, err = proc.communicate()
956954
self.assertEqual(0, proc.returncode)
957955
self.assertIn("[2, 3, 4]", out)
@@ -969,10 +967,9 @@ def test_module_dependency_on_cluster(self):
969967
|def myfunc(x):
970968
| return x + 1
971969
""")
972-
proc = subprocess.Popen(
973-
[self.sparkSubmit, "--py-files", zip, "--master",
974-
"local-cluster[1,1,512]", script],
975-
stdout=subprocess.PIPE)
970+
proc = subprocess.Popen([self.sparkSubmit, "--py-files", zip, "--master",
971+
"local-cluster[1,1,512]", script],
972+
stdout=subprocess.PIPE)
976973
out, err = proc.communicate()
977974
self.assertEqual(0, proc.returncode)
978975
self.assertIn("[2, 3, 4]", out)

python/pyspark/worker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def main(infile, outfile):
5757
SparkFiles._is_running_on_worker = True
5858

5959
# fetch names of includes (*.zip and *.egg files) and construct PYTHONPATH
60-
# *.py files that were added will be copied here
61-
sys.path.append(spark_files_dir)
60+
sys.path.append(spark_files_dir) # *.py files that were added will be copied here
6261
num_python_includes = read_int(infile)
6362
for _ in range(num_python_includes):
6463
filename = utf8_deserializer.loads(infile)

0 commit comments

Comments
 (0)