-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17587][PYTHON][MLLIB] SparseVector __getitem__ should follow __getitem__ contract #15144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #65582 has finished for PR 15144 at commit
|
|
LGTM! |
|
It looks like |
|
@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. |
|
Test build #65608 has finished for PR 15144 at commit
|
|
test this please |
|
Test build #66292 has finished for PR 15144 at commit
|
|
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.