-
- Downloads
[SPARK-17587][PYTHON][MLLIB] SparseVector __getitem__ should follow __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.
Showing
- python/pyspark/ml/linalg/__init__.py 5 additions, 5 deletionspython/pyspark/ml/linalg/__init__.py
- python/pyspark/ml/tests.py 13 additions, 3 deletionspython/pyspark/ml/tests.py
- python/pyspark/mllib/linalg/__init__.py 5 additions, 5 deletionspython/pyspark/mllib/linalg/__init__.py
- python/pyspark/mllib/tests.py 13 additions, 3 deletionspython/pyspark/mllib/tests.py
Loading
Please register or sign in to comment