Hey there, is this possible? I want to default out another parameters based on a previous parameter.
In this example, let’s say
x
is a string and I want to
.lower()
it.
Copy code
flow = Flow("some flow")
with flow:
x = Parameter("x")
y = Parameter("y", default=x.foo())
The use case I will be doing this for is date specification and building dynamic dates based on a main driving parameter
z
Zanie
01/14/2021, 4:26 PM
Hmm, parameter values need to be serializable so I don’t think you can set a default that’s dependent on a runtime value like this.
Zanie
01/14/2021, 4:27 PM
Is there a case where you’d want the user to be able to configure
y
independently of
x
? If you want to have
y
be based on
x
you can just use a normal task
m
Mitchell Bregman
01/14/2021, 4:30 PM
yeah, thats what I will end up doing
Mitchell Bregman
01/14/2021, 4:30 PM
thanks so much, was just curious
Mitchell Bregman
01/14/2021, 4:31 PM
but yes, there is a case where
y
can be independent…. i will just have some handling around that
Mitchell Bregman
01/14/2021, 4:31 PM
and default
y
to None
z
Zanie
01/14/2021, 4:31 PM
No problem! It’d be cool if we could take callables there but since we need to display defaults in the UI and such it becomes a bit of a security concern to execute the code on our end.
Zanie
01/14/2021, 4:32 PM
@Jim Crist-Harif — perhaps a possible use-case for the “secure execution” model 🙂
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.