Github user sethah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15777#discussion_r87841411
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala ---
    @@ -132,7 +132,7 @@ class BisectingKMeansModel private[ml] (
       private var trainingSummary: Option[BisectingKMeansSummary] = None
     
       private[clustering] def setSummary(summary: BisectingKMeansSummary): 
this.type = {
    -    this.trainingSummary = Some(summary)
    +    this.trainingSummary = Option(summary)
    --- End diff --
    
    per @holdenk's suggestion, I changed the `setSummary` to use `Option.apply` 
which treats `null` as `None`. This allows us to exercise the test case for 
`hasSummary` when `summary == None`. This was never tested in Scala either so I 
added unit tests for both Scala and Python.


---
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