From ef18cab56734110d295d3643cafe837a4a6e2ab7 Mon Sep 17 00:00:00 2001 From: Kyle Goodrick Date: Mon, 13 Jan 2025 13:19:18 -0700 Subject: [PATCH] Update `display_mermaid_graph` to match `display_dot_graph` including raw_output (mypy will not allow the function to return only None) --- py-polars/polars/_utils/various.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/py-polars/polars/_utils/various.py b/py-polars/polars/_utils/various.py index 890087dc8dea..293f9153a436 100644 --- a/py-polars/polars/_utils/various.py +++ b/py-polars/polars/_utils/various.py @@ -705,8 +705,15 @@ def display_dot_graph( def display_mermaid_graph( - *, mermaid: str, show: bool = True, output_path: str | Path | None = None -) -> None: + *, + mermaid: str, + show: bool = True, + output_path: str | Path | None = None, + raw_output: bool = False, +) -> str | None: + if raw_output: + return mermaid + # Make font monospace mermaid += r'%%{init: {"fontFamily": "monospace"}}%%' + "\n"