from within a task? If I retrieve the context using
get_run_context
and the
expected_start_time
field from within a task, I get a TaskRunContext and the expected start time for the specific task which is different from the flow's
expected_start_time
by a fair margin, depending on how long it took to actually start the current task.
Sam Cook
02/01/2023, 9:19 PM
I'm on Prefect version 2.7.1 if that's relevant
c
Christopher Boyd
02/02/2023, 2:33 PM
You should be able to get the flow context
Christopher Boyd
02/02/2023, 2:41 PM
Maybe I’m wrong here, and now I can’t find it but you can return / save expected_start_time from the flow context as a global var that the task can access
Christopher Boyd
02/02/2023, 2:46 PM
global start_time = get_run_context().start_time
s
Sam Cook
02/02/2023, 2:56 PM
I'm using a custom flow that lives in a different file from the task, so I can't use globals to transfer state
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.