Hello Prefects, I’am switching from Prefect 1 to 2...
# ask-community
a
Hello Prefects, I’am switching from Prefect 1 to 2 one. And I’m blocked with the DAG free conception. One part of my flow is predefined rigid DAG. How can I achieve “dag behavior” in Prefect 2? Toy example of my graph:
Copy code
graph = {
  "feature_1" : [],
  "feature_2" : [],
  "feature_3" : ["feature_1", "feature_2"],
  "feature_4" : ["feature_3"],
  "feature_5" : ["feature_4"],
}
So how can I “explain” that in the first time we can run in parallel
feature_1
and
feature_2
, but not the others one. We can run
feature_3
, only when
feature_1
and
feature_2
was successfully executed, and feature_3 take like input parameters the results of
feature_1
and
feature_2
. P.S. In production it should be run with
DaskTaskRunner
. Could be there any difficulty?
m
look at this section of the docs, specifically
submit
and
result
. you may also find wait_for useful.
🙌 1
a
@Zanie I have found your code example here: https://prefect-community.slack.com/archives/CL09KU1K7/p1665424063672229?thread_ts=1665419812.995289&cid=CL09KU1K7 Unfortunately, It doesn’t execute features in the graph specified order. Moreover it pass
prefect.tasks.Task object
instead of
PrefectFuture
:(
k
@Aleksandr Liadov I’m curious if you have tried to incorporate
wait_for
and
submit
to your code?
a
For someone who will be blocked with the same problem, the solution: https://discourse.prefect.io/t/how-to-define-dag-like-flow-in-prefect-2-0/2069/7