aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/mllib/tests.py
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@apache.org>2014-08-11 11:54:09 -0700
committerJosh Rosen <joshrosen@apache.org>2014-08-11 11:54:09 -0700
commitdb06a81fb7a413faa3fe0f8c35918f70454cb05d (patch)
tree7d6b7e1766aadf0a875d5577ee349b73c817ceef /python/pyspark/mllib/tests.py
parentba28a8fcbc3ba432e7ea4d6f0b535450a6ec96c6 (diff)
downloadspark-db06a81fb7a413faa3fe0f8c35918f70454cb05d.tar.gz
spark-db06a81fb7a413faa3fe0f8c35918f70454cb05d.tar.bz2
spark-db06a81fb7a413faa3fe0f8c35918f70454cb05d.zip
[PySpark] [SPARK-2954] [SPARK-2948] [SPARK-2910] [SPARK-2101] Python 2.6 Fixes
- Modify python/run-tests to test with Python 2.6 - Use unittest2 when running on Python 2.6. - Fix issue with namedtuple. - Skip TestOutputFormat.test_newhadoop on Python 2.6 until SPARK-2951 is fixed. - Fix MLlib _deserialize_double on Python 2.6. Closes #1868. Closes #1042. Author: Josh Rosen <joshrosen@apache.org> Closes #1874 from JoshRosen/python2.6 and squashes the following commits: 983d259 [Josh Rosen] [SPARK-2954] Fix MLlib _deserialize_double on Python 2.6. 5d18fd7 [Josh Rosen] [SPARK-2948] [SPARK-2910] [SPARK-2101] Python 2.6 fixes
Diffstat (limited to 'python/pyspark/mllib/tests.py')
-rw-r--r--python/pyspark/mllib/tests.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/python/pyspark/mllib/tests.py b/python/pyspark/mllib/tests.py
index 6f3ec8ac94..8a851bd35c 100644
--- a/python/pyspark/mllib/tests.py
+++ b/python/pyspark/mllib/tests.py
@@ -19,8 +19,13 @@
Fuller unit tests for Python MLlib.
"""
+import sys
from numpy import array, array_equal
-import unittest
+
+if sys.version_info[:2] <= (2, 6):
+ import unittest2 as unittest
+else:
+ import unittest
from pyspark.mllib._common import _convert_vector, _serialize_double_vector, \
_deserialize_double_vector, _dot, _squared_distance