Skip to content
Snippets Groups Projects
Commit 6ee1ff26 authored by Josh Rosen's avatar Josh Rosen
Browse files

Fix bug in pyspark.serializers.batch; add .gitignore.

parent c2b105af
No related branches found
No related tags found
No related merge requests found
*.pyc
docs/
...@@ -695,7 +695,9 @@ def _test(): ...@@ -695,7 +695,9 @@ def _test():
import doctest import doctest
from pyspark.context import SparkContext from pyspark.context import SparkContext
globs = globals().copy() globs = globals().copy()
globs['sc'] = SparkContext('local[4]', 'PythonTest') # The small batch size here ensures that we see multiple batches,
# even in these small test examples:
globs['sc'] = SparkContext('local[4]', 'PythonTest', batchSize=2)
doctest.testmod(globs=globs) doctest.testmod(globs=globs)
globs['sc'].stop() globs['sc'].stop()
......
...@@ -24,7 +24,7 @@ def batched(iterator, batchSize): ...@@ -24,7 +24,7 @@ def batched(iterator, batchSize):
if count == batchSize: if count == batchSize:
yield Batch(items) yield Batch(items)
items = [] items = []
count = [] count = 0
if items: if items:
yield Batch(items) yield Batch(items)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment