You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
We should take a look at how parameters'
optional
anddefault
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 bothdefault: 1
andoptional: True
, even though they'd assumed havingdefault: 1
would implicitly mean that no value is required.The text was updated successfully, but these errors were encountered: