Hey everyone - I use a parameter to pass a date to...
# prefect-community
j
Hey everyone - I use a parameter to pass a date to tasks downstream
Copy code
batch_run_date = Parameter(
        name='batch_run_date',
        default=(datetime.today() - timedelta(days=1)).strftime('%Y-%m-%d')
    )
in perfect
0.9.*
this would alter the default value based on the current date. But in prefect
0.10.1
the default date is fixed. Is there a a different way I can reproduce the previous functionality
c
Hi John, Parameter defaults have always been required to be constants so not sure what you saw previously but these were never dynamic; to have a dynamic value right now I recommend placing a task immediately downstream of your parameter that runs your default logic
j
Well when the runs where scheduled in advanced it seemed the default parameter matched the current date