-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Labels
Description
Description
Allowing something like this to work
Node(
# other stuff
# ...
parameters=[
{
"some_array_type": IfElseSubstitution(
condition=some_condition,
if_value=[subs1],
else_value=[subs1, subs2, subs3],
)
},
],
)Motivation
The snippet below works, so it seems intuitive that wrapping that in an if-else substitution would work as well.
Node(
# typical stuff
# ...
parameters=[
{
"some_array_type": [subs1, subs2, subs3],
},
],
)Design / Implementation Considerations
No response
Additional Information
I have no idea if this is feasible or not. The way iterables of substitutions are handled is typically concatenating them, but apparently not when using them for parameters, as that is able to correctly handle lists. I would assume that logic might be usable for IfElseSubstitions as well.
Looking through the allowed types, the parameters allow for
SomeParameterValue = Union[
ParameterValueDescription,
SomeSubstitutionsType,
Sequence[SomeSubstitutionsType],
_SingleValueType,
_MultiValueType
]While IfElseSubstition doesn't handle a sequence and only handles
SomeSubstitutionsType = Union[
Text,
Substitution,
Iterable[Union[Text, Substitution]],
]I would also expect similar limitations exist elsewhere and this is probably not exclusive to IfElseSubstitution.