Radar view does not capture control dependencies?

Consider the following simple conditional flow:


@task
def task_cond():
    # returns True or False randomly, actual implementation omitted
    ...

@task
def task_if_true():
    print('true')

@task
def task_if_false():
    print('false')

@flow
def main():
    if task_cond():
        task_if_true()
    else:
        task_if_false()

Apparently there is a control dependency between task_if_true/task_if_false and task_cond. But it seems Radar view does not capture this kind of dependency, i.e. there is not a edge(in DAG terms) between task_if_true/task_if_false and task_cond on Radar view.

Could anyone explain why? Is it because it’s hard to capture control dependencies, since we can simply use if/else to express conditions in Prefect 2?

Hi @William_Gu :wave: Have a look at this issue which discusses a very similar behavior, specifically this comment.

Hi Emil,

Really appreciate your reply. The discussions in that issue answer my question.

1 Like