Chris O'Brien
05/04/2020, 3:56 AMrun_date
that is yesterday UTC time. I would love to use the prefect context to do this and this worked for me, but is there a better way?Chris White
05/04/2020, 3:12 PMcontext
within a Task is not recommended, and context
should be treated as read-only (unless you are adding values to context through environment variable or the API).
Why do you need to add this to context? You can always compute it within any task, as you did above:
run_date = prefect.context.date.date() - datetime.timedelta(days=1)
Chris O'Brien
05/04/2020, 10:43 PMdate
available via contextChris White
05/04/2020, 10:52 PMChris O'Brien
05/04/2020, 10:54 PM