Uh oh!
There was an error while loading. Please reload this page.
[SPARK-17587][PYTHON][MLLIB] SparseVector __getitem__ should follow __getitem__ contract - #15144
[SPARK-17587][PYTHON][MLLIB] SparseVector __getitem__ should follow __getitem__ contract#15144zero323 wants to merge 6 commits into
Conversation
SparkQA
commented
Sep 18, 2016
Test build #65582 has finished for PR 15144 at commit
|
BryanCutler
commented
Sep 19, 2016
LGTM! |
BryanCutler
commented
Sep 19, 2016
It looks like |
zero323
commented
Sep 19, 2016
@BryanCutler Sure, here you are. Actually both Note: Technically speaking this can is a breaking change if someone expects On a side note it would be nice to support slice and iteration over rows as well but I still hope there is a chance for doing something with SPARK-16626. |
SparkQA
commented
Sep 19, 2016
Test build #65608 has finished for PR 15144 at commit
|
jkbradley
commented
Oct 4, 2016
test this please |
SparkQA
commented
Oct 4, 2016
Test build #66292 has finished for PR 15144 at commit
|
jkbradley
commented
Oct 4, 2016
LGTM, merging with master and branch-2.0 |
…_getitem__ contract ## What changes were proposed in this pull request? Replaces` ValueError` with `IndexError` when index passed to `ml` / `mllib` `SparseVector.__getitem__` is out of range. This ensures correct iteration behavior. Replaces `ValueError` with `IndexError` for `DenseMatrix` and `SparkMatrix` in `ml` / `mllib`. ## How was this patch tested? PySpark `ml` / `mllib` unit tests. Additional unit tests to prove that the problem has been resolved. Author: zero323 <zero323@users.noreply.github.com> Closes#15144 from zero323/SPARK-17587. (cherry picked from commit d8399b6) Signed-off-by: Joseph K. Bradley <joseph@databricks.com>
What changes were proposed in this pull request?
Replaces
ValueErrorwithIndexErrorwhen index passed toml/mllibSparseVector.__getitem__is out of range. This ensures correct iteration behavior.Replaces
ValueErrorwithIndexErrorforDenseMatrixandSparkMatrixinml/mllib.How was this patch tested?
PySpark
ml/mllibunit tests. Additional unit tests to prove that the problem has been resolved.