Hi there again - I remember reading somewhere in t...
# prefect-community
i
Hi there again - I remember reading somewhere in the docs about "hiding" inputs for visualizations. Can't seem to find it. Can you point me to the docs or show an example? Thanks again. Keep up the good work.
c
Hi itay -
flow.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-generation
i
thank you
b
@itay livni fyi I wanted to do the same recently and ended up manually dropping all the tasks/edges I didn’t want to see before plotting, seems to work ok:
Copy code
to_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()
i
@Brett Naul That is really neat! I can see generating two visualizations. One being an outline\summary of the
flow
. And the other being a detailed view. Self documenting code 🙂