From da5e7005a5736fd5eba3dfacc3d2124071e4f404 Mon Sep 17 00:00:00 2001 From: Kevin Conor Date: Fri, 12 Jun 2015 18:16:29 -0700 Subject: [PATCH] Integer division for batch size Itertools islice requires an integer for the stop argument. Switching to integer division here prevents a ValueError when vs is evaluated above. --- python/pyspark/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyspark/serializers.py b/python/pyspark/serializers.py index d8cdcda3a3783..7f9d0a338d31e 100644 --- a/python/pyspark/serializers.py +++ b/python/pyspark/serializers.py @@ -272,7 +272,7 @@ def dump_stream(self, iterator, stream): if size < best: batch *= 2 elif size > best * 10 and batch > 1: - batch /= 2 + batch //= 2 def __repr__(self): return "AutoBatchedSerializer(%s)" % self.serializer