Skip to content

Add support for Parameters of type enum #2117

@svpino

Description

@svpino

It'd be great if we had support for enum parameters.

Here is how we would define a Parameter today:

action = Parameter(
        "action",
        help="The action you want to perform. Supported values are 'traffic' and 'labeling'.",
        default="traffic"
    )

Notice how we need to rely on documentation to let the user know which values are supported. We also need to validate as part of the flow that the supplied value is supported.

Instead, it would be great to do something like this:

action = Parameter(
        "action",
        help="The action you want to perform.",
        type="enum",
        values=["traffic", "labeling"],
        default="traffic"
)

Metaflow could automatically validate the value of the parameter and we won't have to do that as part of the flow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions