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

    https://github.com/apache/spark/pull/12420#discussion_r89698708
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/Pipeline.scala ---
    @@ -111,6 +111,18 @@ class Pipeline @Since("1.4.0") (
       @Since("1.2.0")
       def getStages: Array[PipelineStage] = $(stages).clone()
     
    +  /** Returns stage at index i in Pipeline */
    +  @Since("2.0.0")
    +  def getStage[T <: PipelineStage](i: Int): T = 
getStages.apply(i).asInstanceOf[T]
    +
    +  /** Returns all stages of this type */
    +  @Since("2.0.0")
    +  def getStagesOfType[T <: PipelineStage]: Array[T] = {
    +    getStages.collect {
    --- End diff --
    
    Nit: This is probably more natural as a one-liner


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

Reply via email to