Github user sethah commented on the issue:

    https://github.com/apache/spark/pull/18899
  
    Ok, it's fairly safe since it's limited to `private[linalg]`. The confusion 
for me is that this method introduces all sorts of edge cases which have 
behavior that is not at all obvious or clear. If we don't think we need to test 
all of these edge cases, I'd like to at least be very explicit in the method 
doc, e.g.:
    
    ````scala
      /**
       * This method is used to avoid re-computing the number of non-zero 
elements when it is
       * already known. This method should only be called after computing the 
number of non-zero
       * elements via [[numNonZeros]]. e.g.
       *   {{{
       *     val nnz = this.numNonZeros
       *     val sv = toSparse(nnz)
       *   }}}
       *
       * If `nnz` is under-specified, a 
[[java.lang.ArrayIndexOutOfBoundsException]] is thrown.
       */
    ````


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to