https://prefect.io logo
b

Brett Naul

04/07/2020, 9:09 PM
think I know the answer to this (no?) but is there a way to use values like
today
from https://docs.prefect.io/api/latest/utilities/context.html as parameter defaults? right now I have a separate task that wraps each date param
n

nicholas

04/07/2020, 9:16 PM
Hi @Brett Naul - it's not possible to do that as you've outlined, but you can override values in context by passing 
context
 to either 
flow.run
 or in the 
create_flow_run
 GraphQL call. It's possible that we could expose a kwarg on the Parameter class that would draw defaults from context in the future
b

Brett Naul

04/07/2020, 9:31 PM
I guess just subclassing parameter would work; either have
run()
default to today or allow passing a default_factory ?
upvote 1
c

Chris White

04/07/2020, 10:18 PM
@Brett Naul yea that sounds like a reasonable approach