Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/11784#discussion_r56517612
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/classification/LogisticRegression.scala
---
@@ -508,12 +508,10 @@ class LogisticRegressionModel private[spark] (
* thrown if `trainingSummary == None`.
*/
@Since("1.5.0")
- def summary: LogisticRegressionTrainingSummary = trainingSummary match {
- case Some(summ) => summ
- case None =>
- throw new SparkException(
- "No training summary available for this LogisticRegressionModel",
- new NullPointerException())
+ def summary: LogisticRegressionTrainingSummary =
trainingSummary.getOrElse {
+ throw new SparkException(
+ "No training summary available for this LogisticRegressionModel",
+ new RuntimeException())
--- End diff --
Generally you don't use `RuntimeException` directly... why is the exception
chained anyway and what was wrong with NPE? just kinda inaccurate?
`NoSuchElementException` is what `None.get` throws.
---
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]