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

Optional and default settings for parameters work together confusingly #24

Open
orasimus opened this issue Oct 8, 2019 · 2 comments
Open
Assignees

Comments

@orasimus
Copy link
Contributor

orasimus commented Oct 8, 2019

We should take a look at how parameters' optional and default work.

I would assume something like this:

- default: 1
(- optional: False by default)
-> we set the parameter to 1 if the API call does not define something else

(no default value by default)
- optional: True
-> we can leave the parameter empty, and the Execution will start without a value

- default: 1
- optional: True
-> we set the parameter to 1 if the API call does not define something else, and it can also be left empty, and the Execution will start without a value

Today it works something like this:

- default: 1
(- optional: False by default)
-> if we don't define a value, the Execution does not start

// So here I think it should start if there's a default value given, even if the API call does not give one

(no default value by default)
- optional: True
-> we can leave the parameter empty, and the Execution will start without a value

- default: 1
- optional: True
-> we set the parameter to 1 if the API call does not define something else. If left empty, the Execution will start with the default value of 1.

// So here I think if we on purpose give an empty value, we shouldn't pass the default value on to the execution.

Thoughts?

Ari and Pierre from Skillup encountered this confusion, as they wanted to have an execution that starts even if no value is given, but then using a default value from the valohai.yaml. So they ended up using both default: 1 and optional: True, even though they'd assumed having default: 1 would implicitly mean that no value is required.

@skogstrom
Copy link

parameter_optionality

@orasimus
Copy link
Contributor Author

orasimus commented Oct 7, 2020

Another customer had similar confusions while using the Valohai API.

@tokkoro tokkoro self-assigned this Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants