Have a question about Prefect Context. I Context document under Core Concepts / Execution as well as API Latest / prefect.utilities Context. Both seem to say that users can store items in the context, being careful to not step on any Prefect items, of course, and then retrieve them later. I am attempting to do that but running into trouble. I have created a simple task which receives a "label" to store a time value under. For example, "Start_Flow" would be used to store a time.time() value into the context. That part seems to be working correctly in the task as I can store and then print the stored value. However, in a subsequent task, when I retrieve the "Start_Flow" item from the context, I get a None value. Is there something that I am missing about Context? I am using code similar to the following:
To store:
prefect.context[label] = time.time()
To retrieve:
time_val = prefect.context.get(label)