Does anybody do class based development and deployment with flow code or is this some sort of an anti pattern in Prefect?
For example, I would have a common parent flow that retrieves data to pass to different types of subflows.
• Is it better to inherit that parent flow and deploy with each of the subflows under the same deployment space?
◦ parent_flow/deployment_1, subflow/deployment_1, parent_flow/deployment_2 and subflow/deployment_2
• Or is it better to make the parent it's own separate deployment.
◦ parent_flow/deployment_x, subflow/deployment_1, subflow/deployment_2
n
Nate
07/10/2024, 6:55 PM
hi @Mitch - could you elaborate on what you mean by "class based development"?
generally prefect encourages a functional paradigm, flows can be deployed independently, but also called anywhere by another python function
a
Alan
07/10/2024, 7:43 PM
That clarifies it for us. If prefect is designed around the functional paradigm then that's the development process that's encouraged here.
👍 1
m
Mitch
07/10/2024, 8:18 PM
noted, thank you
n
Nate
07/10/2024, 8:21 PM
fwiw i will say though, we’ve become a bit more lenient on that in prefect 3, where you can have instance/class/static methods as tasks or flows, but that’s more removing what feels like an arbitrary restriction rather than a design recommendation, generally i’d say tasks are still units of work and flows compose units of work, and i think of things functionally most of the time!
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.