Repository: spark
Updated Branches:
  refs/heads/branch-1.1 672f3228c -> 36eed2f9e


[SPARK-8032] [PYSPARK] Make version checking for NumPy in MLlib more robust

The current checking does version `1.x' is less than `1.4' this will fail if x 
has greater than 1 digit, since x > 4, however `1.x` < `1.4`

It fails in my system since I have version `1.10` :P

Author: MechCoder <manojkumarsivaraj...@gmail.com>

Closes #6579 from MechCoder/np_ver and squashes the following commits:

15430f8 [MechCoder] fix syntax error
893fb7e [MechCoder] remove equal to
e35f0d4 [MechCoder] minor
e89376c [MechCoder] Better checking
22703dd [MechCoder] [SPARK-8032] Make version checking for NumPy in MLlib more 
robust

(cherry picked from commit 452eb82dd722e5dfd00ee47bb8b6353933b0016e)
Signed-off-by: Xiangrui Meng <m...@databricks.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/36eed2f9
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/36eed2f9
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/36eed2f9

Branch: refs/heads/branch-1.1
Commit: 36eed2f9ea42bdfe116b9578fc54b50b25f44f3c
Parents: 672f322
Author: MechCoder <manojkumarsivaraj...@gmail.com>
Authored: Tue Jun 2 23:24:47 2015 -0700
Committer: Xiangrui Meng <m...@databricks.com>
Committed: Tue Jun 2 23:26:20 2015 -0700

----------------------------------------------------------------------
 python/pyspark/mllib/__init__.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/36eed2f9/python/pyspark/mllib/__init__.py
----------------------------------------------------------------------
diff --git a/python/pyspark/mllib/__init__.py b/python/pyspark/mllib/__init__.py
index 0c7f491..bfab960 100644
--- a/python/pyspark/mllib/__init__.py
+++ b/python/pyspark/mllib/__init__.py
@@ -22,7 +22,9 @@ Python bindings for MLlib.
 # MLlib currently needs and NumPy 1.4+, so complain if lower
 
 import numpy
-if numpy.version.version < '1.4':
+
+ver = [int(x) for x in numpy.version.version.split('.')[:2]]
+if ver < [1, 4]:
     raise Exception("MLlib requires NumPy 1.4+")
 
 __all__ = ['classification', 'clustering', 'linalg', 'random',


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to