Skip to content
  • zero323's avatar
    d8399b60
    [SPARK-17587][PYTHON][MLLIB] SparseVector __getitem__ should follow __getitem__ contract · d8399b60
    zero323 authored
    ## 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.
    d8399b60
    [SPARK-17587][PYTHON][MLLIB] SparseVector __getitem__ should follow __getitem__ contract
    zero323 authored
    ## 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.
Loading