Tarek
05/16/2023, 2:39 PMfoofuncs = get_functions(foo)
run_funcs(funcs) #but as tasks not just functions to profit from prefect's tasks scheduling algorithmsMarvin
05/16/2023, 2:40 PM@taskpython
from prefect import Flow, task, Parameter
@task
def func_a():
    return "Function A executed"
@task
def func_b():
    return "Function B executed"
@task
def run_funcs(func):
    return func()
with Flow("dynamic_tasks") as flow:
    foo = Parameter("foo")
    if foo == "a":
        result = run_funcs(func_a)
    elif foo == "b":
        result = run_funcs(func_b)
flow.run(parameters={"foo": "a"})foofunc_afunc_brun_funcsBring 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.
Powered by