Skip to content

Commit 4c16f79

Browse files
committed
Merge pull request apache#426 from mateiz/py-ml-tests
Re-enable Python MLlib tests (require Python 2.7 and NumPy 1.7+) We disabled these earlier because Jenkins didn't have these versions.
2 parents bf56995 + 5b3a3e2 commit 4c16f79

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

python/pyspark/mllib/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,13 @@
1818
"""
1919
Python bindings for MLlib.
2020
"""
21+
22+
# MLlib currently needs Python 2.7+ and NumPy 1.7+, so complain if lower
23+
24+
import sys
25+
if sys.version_info[0:2] < (2, 7):
26+
raise Exception("MLlib requires Python 2.7+")
27+
28+
import numpy
29+
if numpy.version.version < '1.7':
30+
raise Exception("MLlib requires NumPy 1.7+")

python/run-tests

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ run_test "-m doctest pyspark/broadcast.py"
4040
run_test "-m doctest pyspark/accumulators.py"
4141
run_test "-m doctest pyspark/serializers.py"
4242
run_test "pyspark/tests.py"
43-
#run_test "pyspark/mllib/_common.py"
44-
#run_test "pyspark/mllib/classification.py"
45-
#run_test "pyspark/mllib/clustering.py"
46-
#run_test "pyspark/mllib/recommendation.py"
47-
#run_test "pyspark/mllib/regression.py"
43+
run_test "pyspark/mllib/_common.py"
44+
run_test "pyspark/mllib/classification.py"
45+
run_test "pyspark/mllib/clustering.py"
46+
run_test "pyspark/mllib/recommendation.py"
47+
run_test "pyspark/mllib/regression.py"
4848

4949
if [[ $FAILED != 0 ]]; then
5050
echo -en "\033[31m" # Red

0 commit comments

Comments
 (0)