prefect.utilities.visualization
Utilities for working with Flow.visualize()
TaskVizTracker
Source code in src/prefect/utilities/visualization.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
link_viz_return_value_to_viz_task(viz_return_value, viz_task)
We cannot track booleans, Ellipsis, None, NotImplemented, or the integers from -5 to 256 because they are singletons.
Source code in src/prefect/utilities/visualization.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
build_task_dependencies(task_run_tracker)
Constructs a Graphviz directed graph object that represents the dependencies between tasks in the given TaskVizTracker.
- task_run_tracker (TaskVizTracker): An object containing tasks and their dependencies.
- graphviz.Digraph: A directed graph object depicting the relationships and dependencies between tasks.
Raises:
- GraphvizImportError: If there's an ImportError related to graphviz.
- FlowVisualizationError: If there's any other error during the visualization
process or if return values of tasks are directly accessed without
specifying a viz_return_value
.
Source code in src/prefect/utilities/visualization.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
|
track_viz_task(is_async, task_name, parameters, viz_return_value=None)
Return a result if sync otherwise return a coroutine that returns the result
Source code in src/prefect/utilities/visualization.py
37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
visualize_task_dependencies(graph, flow_run_name)
Renders and displays a Graphviz directed graph representing task dependencies.
The graph is rendered in PNG format and saved with the name specified by flow_run_name. After rendering, the visualization is opened and displayed.
Parameters: - graph (graphviz.Digraph): The directed graph object to visualize. - flow_run_name (str): The name to use when saving the rendered graph image.
Raises:
- GraphvizExecutableNotFoundError: If Graphviz isn't found on the system.
- FlowVisualizationError: If there's any other error during the visualization
process or if return values of tasks are directly accessed without
specifying a viz_return_value
.
Source code in src/prefect/utilities/visualization.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|