Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/14824#discussion_r76418318
--- Diff:
mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala ---
@@ -454,10 +454,15 @@ class SparseMatrix @Since("2.0.0") (
require(values.length == rowIndices.length, "The number of row indices
and values don't match! " +
s"values.length: ${values.length}, rowIndices.length:
${rowIndices.length}")
- // The Or statement is for the case when the matrix is transposed
- require(colPtrs.length == numCols + 1 || colPtrs.length == numRows + 1,
"The length of the " +
- "column indices should be the number of columns + 1. Currently,
colPointers.length: " +
- s"${colPtrs.length}, numCols: $numCols")
+ if (isTransposed) {
+ require(colPtrs.length == numRows + 1, "The length of the column
indices should be " +
--- End diff --
I think our style would be to indent subsequent lines in a continuation.
You might just simplify these messages to something like
```
require(...,
s"Expecting ${numRows + 1} colPtrs when numRows = $numRows but got
${colPtrs.length}")
```
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]