itay livni
10/22/2019, 3:46 AMChris White
10/22/2019, 4:46 AMflow.visualize()
will always display all tasks within your flow. You might be referring to Prefect’s auto-generated tasks (e.g., if you provide a standard python dictionary as an input to a task, prefect will create tasks for every key, value, etc.) There is some information here: https://docs.prefect.io/core/tutorials/task-guide.html#adding-tasks-to-flows on how to avoid this auto-generationitay livni
10/22/2019, 5:38 AMBrett Naul
10/23/2019, 3:15 PMto_viz = flow.copy()
to_skip = {'Constant', '/', 'Add', 'Div', '1.0', 'GetItem', '0'}
to_viz.edges = {edge for edge in to_viz.edges if not any(s in task.name for task in edge.tasks for s in to_skip)}
to_viz.tasks = {task for task in to_viz.tasks if not any(s in task.name for s in to_skip)}
to_viz.visualize()
itay livni
10/23/2019, 4:09 PMflow
. And the other being a detailed view. Self documenting code 🙂