spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject spark git commit: [SPARK-16035][PYSPARK] Fix SparseVector parser assertion for end parenthesis
Date Sat, 18 Jun 2016 05:41:20 GMT
Repository: spark
Updated Branches:
  refs/heads/branch-2.0 2859ea3ec -> 2066258ef


[SPARK-16035][PYSPARK] Fix SparseVector parser assertion for end parenthesis

## What changes were proposed in this pull request?
The check on the end parenthesis of the expression to parse was using the wrong variable.
I corrected that.
## How was this patch tested?
Manual test

Author: andreapasqua <andrea@radius.com>

Closes #13750 from andreapasqua/sparse-vector-parser-assertion-fix.

(cherry picked from commit 4c64e88d5ba4c36cbdbc903376492f0f43401e4e)
Signed-off-by: Xiangrui Meng <meng@databricks.com>


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

Branch: refs/heads/branch-2.0
Commit: 2066258eff18b1c98ac30d59b224c40a9af1c482
Parents: 2859ea3
Author: andreapasqua <andrea@radius.com>
Authored: Fri Jun 17 22:41:05 2016 -0700
Committer: Xiangrui Meng <meng@databricks.com>
Committed: Fri Jun 17 22:41:17 2016 -0700

----------------------------------------------------------------------
 python/pyspark/mllib/linalg/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/2066258e/python/pyspark/mllib/linalg/__init__.py
----------------------------------------------------------------------
diff --git a/python/pyspark/mllib/linalg/__init__.py b/python/pyspark/mllib/linalg/__init__.py
index 70509a6..3a345b2 100644
--- a/python/pyspark/mllib/linalg/__init__.py
+++ b/python/pyspark/mllib/linalg/__init__.py
@@ -569,7 +569,7 @@ class SparseVector(Vector):
         if start == -1:
             raise ValueError("Tuple should start with '('")
         end = s.find(')')
-        if start == -1:
+        if end == -1:
             raise ValueError("Tuple should end with ')'")
         s = s[start + 1: end].strip()
 


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


Mime
View raw message