Hi Humans,
I have a hopefully quick question that I need help with. I am supporting a Prefect installation which I would like to clean up the code base since there is a lot of boilerplate, I am considering using a single python source file and add the necessary flow name, parameters and whatever else from a database query . But I realized that each flow must be registered so using a single python file this way may not work... So my question is will it work, and how would I register the individual flows? Thanks!!
k
Kevin Kho
09/07/2021, 8:47 PM
Hi @Frederick Thomas, you can register multiple flows in the same file.
Copy code
with Flow("Parameter Sample") as flow:
start_date = Parameter(name="start_date")
abc(start_date)
with Flow("Parameter Sample") as flow1:
end_date = Parameter(name="end_date")
abc(end_date)
flow.register(..)
flow1.register(..)
Kevin Kho
09/07/2021, 8:48 PM
CLI with
prefect register
will also register all the flows found in that file
f
Frederick Thomas
09/07/2021, 9:49 PM
My use case would then be to call all the flows within one file? 😃
Bring 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.