https://prefect.io logo
Title
n

Nils

02/06/2023, 1:28 PM
What is the reason that this code throws
RuntimeError: Tasks cannot be run outside of a flow
? The
parse
function is a task.
with ThreadPoolExecutor() as executor
   res = [executor.submit(parse, root, n) for n in range(0, table_count, 5)]

data = [r.result() for r in as_completed(res)]
a

ale

02/06/2023, 2:21 PM
Not sure it is the cause of the error, but I think you’re missing a
:
after
with ThreadPoolExecutor() as executor