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

    https://github.com/apache/spark/pull/19599#discussion_r156913602
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/param/params.scala ---
    @@ -435,6 +435,43 @@ class BooleanParam(parent: String, name: String, doc: 
String) // No need for isV
       }
     }
     
    +/**
    + * :: DeveloperApi ::
    + * Specialized version of `Param[String]` for Java.
    + */
    +@DeveloperApi
    +class StringParam(parent: Params, name: String, doc: String, isValid: 
String => Boolean)
    +  extends Param[String](parent, name, doc, isValid) {
    +
    +  private var options: Option[Array[String]] = None
    --- End diff --
    
    I see your point regarding a use case to support "free text" strings among 
to support strings from a fixed set of options. But to support these two 
different use cases I would go for to have two different string params. One for 
enum like strings and one for free text strings this way the type safety is 
still at our side. Like EnumStringParam and FreeTextStringParam or any other 
better name we come up with.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to