PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
15.31k stars 1.5k forks source link

support nested tasks in flow run graph #14271

Closed jakekaplan closed 2 days ago

jakekaplan commented 4 days ago

OSS pr of: https://github.com/PrefectHQ/nebula/pull/7996

This PR updates the flow run graph to support graphing nested tasks closer to how we represent subflows, by adding a new field Node.encapsulating.

This field is meant to represent tasks that are the encapsulating tasks that call another task, e.g.:

from prefect import flow, task

@task
def nested_task():
    return

@task
def task():
    nested_task()

@flow
def my_flow():
    task()

if __name__ == '__main__':
    my_flow()

This graph has no edges, but nested_task will be represented to be "encapsulated" by task. This PR requires a companion UI pr before it can be merged.

pleek91 commented 2 days ago

Closes https://github.com/PrefectHQ/prefect/issues/13970 (this is the last PR that needs to be merged)