How would i pass the flow_run_id into the task this function and further into the task decorator?
Copy code
@task(cache_key_fn=cache_within_flow_run)
def cached_task():
print('running an expensive operation')
return 42
✅ 1
m
Mason Menges
10/28/2022, 9:29 PM
Hey @Nic The context of the flow run isn't dependent on the file you're running your tasks in, i.e. both the flow and the task decorators are context aware as they're tied to the flow when it's running, if that makes sense. I don't think you would need to make any special changes in this circumstance.
n
Nic
11/01/2022, 8:48 AM
Hi @Mason Menges - When using it like described but calling task from flow and inserting the two codeblock in the task file i get get followring error
AttributeError: 'TaskRunContext' object has no attribute 'flow_run_id'
Nic
11/01/2022, 10:18 PM
I was able to get around it with following code snippet
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.