b

    Brett Naul

    2 years ago
    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
    nicholas

    nicholas

    2 years ago
    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

    2 years ago
    I guess just subclassing parameter would work; either have
    run()
    default to today or allow passing a default_factory ?
    Chris White

    Chris White

    2 years ago
    @Brett Naul yea that sounds like a reasonable approach