|
42 | 42 | import tests.resources.display_name_list_functions |
43 | 43 | import tests.resources.dummy_functions |
44 | 44 | import tests.resources.dummy_functions_module_override |
| 45 | +import tests.resources.dynamic_parallelism.parallel_collect_multiple_arguments |
45 | 46 | import tests.resources.extract_column_nodes |
46 | 47 | import tests.resources.extract_columns_execution_count |
47 | 48 | import tests.resources.functions_with_generics |
@@ -1198,6 +1199,32 @@ def test_function_graph_display_config_node(): |
1198 | 1199 | assert any(line.startswith("\tX") for line in dot.body) |
1199 | 1200 |
|
1200 | 1201 |
|
| 1202 | +def test_function_graph_display_collect_edges_only_style_collected_dependency(): |
| 1203 | + config = {} |
| 1204 | + fg = graph.FunctionGraph.from_modules( |
| 1205 | + tests.resources.dynamic_parallelism.parallel_collect_multiple_arguments, config=config |
| 1206 | + ) |
| 1207 | + |
| 1208 | + assert fg.nodes["summed"].node_role == NodeType.COLLECT |
| 1209 | + assert fg.nodes["summed"].collect_dependency == "double" |
| 1210 | + |
| 1211 | + dot = fg.display(set(fg.get_nodes()), output_file_path=None, config=config) |
| 1212 | + |
| 1213 | + edge_lines = { |
| 1214 | + line.strip().split(" [", 1)[0]: line.strip() for line in dot.body if " -> " in line |
| 1215 | + } |
| 1216 | + assert edge_lines["double -> summed"] == "double -> summed [arrowtail=crow dir=both]" |
| 1217 | + assert edge_lines["not_to_repeat -> summed"] == "not_to_repeat -> summed" |
| 1218 | + assert ( |
| 1219 | + edge_lines["something_else_not_to_repeat -> summed"] |
| 1220 | + == "something_else_not_to_repeat -> summed" |
| 1221 | + ) |
| 1222 | + assert ( |
| 1223 | + edge_lines["number_to_repeat -> double"] |
| 1224 | + == "number_to_repeat -> double [arrowhead=crow arrowtail=none dir=both]" |
| 1225 | + ) |
| 1226 | + |
| 1227 | + |
1201 | 1228 | # TODO use high-level visualization dot as fixtures for reuse across tests |
1202 | 1229 | def test_display_config_node(): |
1203 | 1230 | """Check if config is displayed by high-level hamilton.driver.display...""" |
|
0 commit comments