Donny Flynn
11/01/2021, 10:25 PMwith Flow(FLOW_NAME, storage=STORAGE, run_config=RUN_CONFIG,) as flow:
Task_with_secret_pulling()
The task failed with this error message: `Error during execution of task: ValueError("Could not infer an active Flow context while creating edge to <Task: LessThan>. This often means you called a task outside a with Flow(...)
block. If you're trying to run this task outside of a Flow context, you need to call `LessThan(...).run(...)`")`.
Then I brought all secrets to the flow level which created them as separate tasks, but I am curious: is it the Prefect intention to have each "get" of a Secret be a separate task?Kevin Kho
Secret
is a special task that so if you use it outside. a Flow block, you need to use .get()
explicitly to pull the value similar to how you can do task.run()
inside another task. So yes the intention is for them to be separate tasks. You aren’t charged for tasks that run for below 1 second also. I’d like to say you aren’t charged for Secrets but I can confirm if you want.Donny Flynn
11/02/2021, 12:37 AM