Github user yanboliang commented on the issue:

    https://github.com/apache/spark/pull/12790
  
    @BryanCutler I found when fitting a Scala Pipeline with no stages,
    ```
    val pipeline = new Pipeline()
    val model = pipeline.fit(df)
    ```
    it throw exceptions:
    ```
    Failed to find a default value for stages
    java.util.NoSuchElementException: Failed to find a default value for stages
        at 
org.apache.spark.ml.param.Params$$anonfun$getOrDefault$2.apply(params.scala:660)
        at 
org.apache.spark.ml.param.Params$$anonfun$getOrDefault$2.apply(params.scala:660)
        at scala.Option.getOrElse(Option.scala:121)
        at org.apache.spark.ml.param.Params$class.getOrDefault(params.scala:659)
        at org.apache.spark.ml.PipelineStage.getOrDefault(Pipeline.scala:42)
        at org.apache.spark.ml.param.Params$class.$(params.scala:664)
        at org.apache.spark.ml.PipelineStage.$(Pipeline.scala:42)
        at org.apache.spark.ml.Pipeline.transformSchema(Pipeline.scala:177)
        at org.apache.spark.ml.PipelineStage.transformSchema(Pipeline.scala:70)
        at org.apache.spark.ml.Pipeline.fit(Pipeline.scala:132)
    ```
    I'm more prefer to make Scala and Python have consistent behavior.


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