-
Notifications
You must be signed in to change notification settings - Fork 29k
[ML][MLLIB]The require condition and message doesn't match in SparseMatrix. #14824
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 #64463 has finished for PR 14824 at commit
|
| 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") | ||
| require(!isTransposed && colPtrs.length == numCols + 1 || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be clearer if you just have two clauses:
if (isTransposed) {
require(...)
} else {
require(...)
}
That lets you write a shorter specific message in both cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @srowen , code is updated.
| "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 " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thanks @srowen
|
Test build #64480 has finished for PR 14824 at commit
|
|
Test build #64481 has finished for PR 14824 at commit
|
|
Test build #64483 has finished for PR 14824 at commit
|
|
Test build #64484 has finished for PR 14824 at commit
|
…Matrix. ## What changes were proposed in this pull request? The require condition and message doesn't match, and the condition also should be optimized. Small change. Please kindly let me know if JIRA required. ## How was this patch tested? No additional test required. Author: Peng, Meng <peng.meng@intel.com> Closes #14824 from mpjlu/smallChangeForMatrixRequire. (cherry picked from commit 40168db) Signed-off-by: Sean Owen <sowen@cloudera.com>
|
Merged to master/2.0 |
What changes were proposed in this pull request?
The require condition and message doesn't match, and the condition also should be optimized.
Small change. Please kindly let me know if JIRA required.
How was this patch tested?
No additional test required.