You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "yuhao yang (JIRA)" <ji...@apache.org> on 2017/10/28 19:22:00 UTC

[jira] [Created] (SPARK-22381) Add StringParam that supports valid options

yuhao yang created SPARK-22381:
----------------------------------

             Summary: Add StringParam that supports valid options
                 Key: SPARK-22381
                 URL: https://issues.apache.org/jira/browse/SPARK-22381
             Project: Spark
          Issue Type: New Feature
          Components: ML
    Affects Versions: 2.2.0
            Reporter: yuhao yang
            Priority: Minor


During test with https://issues.apache.org/jira/browse/SPARK-22331, I found it might be a good idea to include the possible options in a StringParam.

A StringParam extends Param[String] and allow user to specify the valid options in Array[String] (case insensitive).

So far it can help achieve three goals:
1. Make the StringParam aware of its possible options and support native validations.
2. StringParam can list the supported options when user input wrong value.
3. allow automatic unit test coverage for case-insensitive String param

and IMO it also decrease the code redundancy.

The StringParam is designed to be completely compatible with existing Param[String], just adding the extra logic for supporting options, which means we don't need to convert all Param[String] to StringParam until we feel comfortable to do that.
    




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org