Milly gupta
04/19/2021, 1:24 PMKevin Kho
Kevin Kho
Milly gupta
04/19/2021, 1:33 PMMilly gupta
04/19/2021, 1:48 PMSo I have created test_module.py from prefect import task, Flow
from prefect.storage import Module
@task
def say_hello():
print("hello world")
flow = Flow("hello-flow")
flow.storage = Module("test_module")
flow.storage.add_flow(flow)
flow.add_task(say_hello)
Milly gupta
04/19/2021, 1:48 PMMilly gupta
04/19/2021, 1:49 PMfrom test_module import flow
flow.run_config = LocalRun(labels=["mg-test"])
flow.register(project_name="CDP")
Milly gupta
04/19/2021, 1:49 PMFlorian Kühnlenz
04/19/2021, 1:52 PMKevin Kho
with Flow("") as flow:
and then putting the tasks underneath. Second is that you can just have flow.register
at the end of the file, but I think for ModuleStorage, it normally makes sense to have Flows inside a folder and register those flows all at once with the command line like in the previous linked thread. I believe this will all work though.Kevin Kho
Kevin Kho
Marvin
04/19/2021, 1:53 PMMilly gupta
04/19/2021, 1:58 PMMilly gupta
04/19/2021, 1:58 PM