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

tree_format prints invalid graph #13700

Closed
2 tasks done
mcrumiller opened this issue Jan 13, 2024 · 0 comments · Fixed by #14020
Closed
2 tasks done

tree_format prints invalid graph #13700

mcrumiller opened this issue Jan 13, 2024 · 0 comments · Fixed by #14020
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@mcrumiller
Copy link
Contributor

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

from polars import col, int_range
expr = (col("a") + col("b"))**2 + int_range(3)
expr.meta.tree_format()

Log output

0                  1           2              3                  4              5
   ┌────────────────────────────────────────────────────────────────────────────────────────────────────
   │
   │      ╭───────────╮
 0 │      │ binary: + │
   │      ╰───────────╯
   │            │ ╰─────────────────╮      ────╮    ──────────╮
   │            │                                             │
   │            │                                             │
   │ ╭─────────────────────╮                          ╭───────────────╮
 1 │ │ function: int_range │                          │ function: pow │
   │ ╰─────────────────────╯                          ╰───────────────╯
   │            │ ╰─────────────────╮──────────╮    ──────────╮──────────────────╮
   │            │                   │                         │                  │
   │            │                   │                         │                  │
   │       ╭────────╮          ╭────────╮                ╭────────╮        ╭───────────╮
 2 │       │ lit(3) │          │ lit(0) │                │ lit(2) │        │ binary: + │
   │       ╰────────╯          ╰────────╯                ╰────────╯        ╰───────────╯
   │                                                                             │ ╰─────────────╮
   │                                                                             │               │
   │                                                                             │               │
   │                                                                        ╭────────╮      ╭────────╮
 3 │                                                                        │ col(b) │      │ col(a) │
   │                                                                        ╰────────╯      ╰────────╯

Issue description

I haven't dived into the details, but sometimes the graph that is returned is invalid.

Related to #11176 most likely.

Expected behavior

Should produce valid graph.

Installed versions

--------Version info---------
Polars:               0.20.4
Index type:           UInt32
Platform:             Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Python:               3.11.3 (main, Apr 15 2023, 14:44:51) [GCC 11.3.0]

----Optional dependencies----
adbc_driver_manager:  0.8.0
cloudpickle:          3.0.0
connectorx:           0.3.2
deltalake:            0.15.0
fsspec:               2023.12.2
gevent:               23.9.1
hvplot:               0.9.1
matplotlib:           3.8.2
numpy:                1.26.3
openpyxl:             3.1.2
pandas:               2.1.4
pyarrow:              14.0.2
pydantic:             2.5.3
pyiceberg:            0.5.1
pyxlsb:               1.0.10
sqlalchemy:           2.0.25
xlsx2csv:             0.8.1
xlsxwriter:           3.1.9
@mcrumiller mcrumiller added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant