https://prefect.io logo
p

Pedro Machado

12/01/2020, 5:09 AM
Hi there. We have a common pattern across flows where we have a
start_date
parameter that is not required. When the parameter is passed, we validate it and use it in the flow. When it's not passed, we use the flow's
scheduled_start_time
to derive the start date. This complicates the flow a little bit. I normally have to create a downstream task that takes the
Parameter
result and applies this logic. I was thinking that it would be nice to be able to pass a callable as the
default
argument of the
Parameter
class to provide a value if the parameter is missing. Similarly, it would be nice to have a
validator
callable that could be used to validate the parameter value. Is there another way to accomplish this? Thoughts?
🧐 1