Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to LazyFrame.explain to export logical plan as Mermaid string #12075

Open
universalmind303 opened this issue Oct 27, 2023 · 1 comment · May be fixed by #20631
Open

Add option to LazyFrame.explain to export logical plan as Mermaid string #12075

universalmind303 opened this issue Oct 27, 2023 · 1 comment · May be fixed by #20631
Labels
A-api Area: changes to the public API accepted Ready for implementation enhancement New feature or an improvement of an existing feature

Comments

@universalmind303
Copy link
Collaborator

Description

mermaid is a pretty common tool for visualizing graph data, and integrates directly into github & gitlab.

It'd be a nice addition to our other display formats like dotviz to_dot.

Ideally i'd like to see something like

lf = (pl.scan_csv("some_file.csv")
# ...
.select(pl.col("a")))

mermaid_string = lf.to_mermaid()

print(mermaid_string)
@universalmind303 universalmind303 added the enhancement New feature or an improvement of an existing feature label Oct 27, 2023
@stinodego stinodego added the A-api Area: changes to the public API label Feb 18, 2024
@stinodego stinodego changed the title Add to_mermaid for logical plans Add option to LazyFrame.explain to export logical plan as Mermaid string May 25, 2024
@stinodego
Copy link
Member

stinodego commented May 25, 2024

I don't want to add a to_mermaid, but it might make sense as an option on explain.

Currently, explain has a boolean argument tree_format. It could become a format parameter with various options, including "mermaid" or "dot". We should probably go ahead and update this right now (UPDATE: #16486).

If this can be added without a lot of code / dependency bloat, I would welcome the addition. Feel free to open a PR so we can have a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-api Area: changes to the public API accepted Ready for implementation enhancement New feature or an improvement of an existing feature
Projects
Status: Ready
Development

Successfully merging a pull request may close this issue.

2 participants