https://prefect.io logo
#prefect-community
Title
# prefect-community
n

Noam Gal

03/31/2022, 12:44 PM
Hey, Congrats for releasing prefect 2.0 (beta). We currently were in the middle of using prefect 1.0 and none of our pipelines were production ready so we decided to move on and adopt Prefect 2.0 orion at first. At our pipeline we were using <task>.run to call a task from other task (not sure if that was kind of a workaround), but now this feature seems to be lost. Is there any workaround for doing that on prefect 2.0 ? (calling a task from other task) Are there any guidelines for moving from prefect 1.0 to prefect 2.0? Thanks!
🥳 1
k

Kevin Kho

03/31/2022, 12:48 PM
It’s not yet there but
task.fn()
will be exposed as the
task.run()
equivalent. There are still some pieces being worked out with Storage before a migration guide will be released
👀 1
n

Noam Gal

03/31/2022, 12:58 PM
Thanks @Kevin Kho! Is there any due date for this
task.fn()
?
k

Kevin Kho

03/31/2022, 1:22 PM
No timeline at the moment
a

Anna Geller

03/31/2022, 2:53 PM
@Noam Gal why not make it a subflow? in Prefect 2.0, you can replace the
@task
decorator with a flow decorator. This way, you can call it in any other flow. I believe this is a much better (and much easier to reason about) pattern than calling tasks from other tasks. In the Radar view, you could then even drill down from a parent flow to a child flow (subflow) which makes it that much easier to troubleshoot when something goes wrong, not even mentioning the modularity/composability of subflows making your workflow code cleaner and more reusable.
🙌 1
6 Views