jcozar
04/07/2023, 5:54 PMwith prefect.context({"date": datetime.datetime(2011, 1, 1)}):
to set context variables and test my flows. Is there something similar in prefect 2.0 to set the start_date
variable from the flow run context (prefect.context.get_run_context()
)?
Thank you!Chris White
04/07/2023, 6:14 PMstart_date
I think you'll want prefect.runtime.flow_run.scheduled_start_time
(ref: https://docs.prefect.io/latest/api-ref/prefect/runtime/flow_run/)jcozar
04/07/2023, 7:30 PMprefect.context.get_run_context().start_date
⢠For testing purposes, I want to run my flow but setting the start_date to, for example, 2011-01-01.
In prefect 1.0 there was a context that allowed to set the context variables to specific values just for testing purposes. Sorry if I missed it from the documentation, but I don't see it!
Thank you again!Chris White
04/07/2023, 7:41 PMruntime
but I think it's a good enhancement request - would you mind opening an issue for it?jcozar
04/07/2023, 8:37 PM