From 0b1f35eb4987fac14da4d75f349c752793ecc7ec Mon Sep 17 00:00:00 2001 From: Stefano Fiorucci Date: Tue, 10 Sep 2024 06:23:45 -0700 Subject: [PATCH] fix: fix Pipeline rendering by replacing `*` with `*` (#8349) * replace * with * * reno --- haystack/core/pipeline/draw.py | 4 ++-- releasenotes/notes/fix-pipe-rendering-50261e0472f0d267.yaml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix-pipe-rendering-50261e0472f0d267.yaml diff --git a/haystack/core/pipeline/draw.py b/haystack/core/pipeline/draw.py index c6c61f3257..83df791515 100644 --- a/haystack/core/pipeline/draw.py +++ b/haystack/core/pipeline/draw.py @@ -139,11 +139,11 @@ def _to_mermaid_text(graph: networkx.MultiDiGraph) -> str: connections_list.append(conn_string) input_connections = [ - f"i{{*}} -- \"{conn_data['label']}
{conn_data['conn_type']}\" --> {states[to_comp]}" + f"i{{*}}--\"{conn_data['label']}
{conn_data['conn_type']}\"--> {states[to_comp]}" for _, to_comp, conn_data in graph.out_edges("input", data=True) ] output_connections = [ - f"{states[from_comp]} -- \"{conn_data['label']}
{conn_data['conn_type']}\"--> o{{*}}" + f"{states[from_comp]}--\"{conn_data['label']}
{conn_data['conn_type']}\"--> o{{*}}" for from_comp, _, conn_data in graph.in_edges("output", data=True) ] connections = "\n".join(connections_list + input_connections + output_connections) diff --git a/releasenotes/notes/fix-pipe-rendering-50261e0472f0d267.yaml b/releasenotes/notes/fix-pipe-rendering-50261e0472f0d267.yaml new file mode 100644 index 0000000000..59bb282f5f --- /dev/null +++ b/releasenotes/notes/fix-pipe-rendering-50261e0472f0d267.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fix the Pipeline visualization issue due to changes in the new release of Mermaid.