Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Add support for StrEnum|Literal type parameters #11385

Open
tumido opened this issue Nov 18, 2024 · 1 comment
Open

[feature] Add support for StrEnum|Literal type parameters #11385

tumido opened this issue Nov 18, 2024 · 1 comment

Comments

@tumido
Copy link

tumido commented Nov 18, 2024

Feature Area

/area frontend
/area backend
/area sdk

Not sure if the choice of feature area is 100% correct, please correct me if I'm wrong.

What feature would you like to see?

In many cases a pipeline author has a pretty strict idea about the options they want to allow users to choose from - a single (or even multi) choice params if you will. As of today KFP supports only a few arbitrary types, where str is the widest of all. It would be neat if could can narrow it down to a single choice selection dropdown in cases when the parameter value is explicitly requested to be constrained and the supported values are known ahead of time.

This will help in cases like:

  • GPU accelerator selection
  • Supported models selection
  • Quantization type selection
  • Storage class selection
  • etc.

Having such option helps in navigating users, reduces mistakes and amount of failed executions because of typos and allows the pipeline author to provide a clear list of supported option values, etc...

What is the use case or pain point?

Using a string type for a single choice parameter value is cumbersome since it requires the user to know which values are supported (this can be only done via documentation) and requires runtime checks for valid input.

Is there a workaround currently?

For a choice between 2 options a bool param can be used, for more than 2 options a str param. As noted above, this is not ideal...


Love this idea? Give it a 👍.

@HumairAK
Copy link
Collaborator

Love this, I think this would be a great addition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants