Joshua Grant
11/22/2022, 6:47 PMapply_map
? Details in 🧵from prefect import apply_map, Flow
from mycode import task1, task2, task3, get_org
def extract_from_file(file: dict, organization: str):
task1_results = task1(file['key'])
task2_results = task2(file['another_key'])
task3_results = task3(file['yet_another_key'], organization)
with Flow('this-flow', ) as this_flow:
files = Parameter('files')
organization = get_org()
flow_file = apply_map(
extract_from_file,
file=files,
organization=unmapped(organization),
)
Zanie
11/22/2022, 7:08 PMfor file in files:
task1.submit(file["key"])
task2.submit(file["another_key"])
etc...
Joshua Grant
11/22/2022, 7:09 PMZanie
11/22/2022, 7:19 PM