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

entered unreachable code when using collect_schema and concat #18198

Closed
2 tasks done
da2225 opened this issue Aug 14, 2024 · 1 comment · Fixed by #18262
Closed
2 tasks done

entered unreachable code when using collect_schema and concat #18198

da2225 opened this issue Aug 14, 2024 · 1 comment · Fixed by #18262
Assignees
Labels
A-panic Area: code that results in panic exceptions accepted Ready for implementation bug Something isn't working P-medium Priority: medium python Related to Python Polars

Comments

@da2225
Copy link

da2225 commented Aug 14, 2024

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

import polars as pl

empty = pl.LazyFrame()
empty.collect_schema()
pl.concat([empty, empty]).collect()

Log output

found multiple sources; run comm_subplan_elim
thread '<unnamed>' panicked at crates/polars-mem-engine/src/planner/lp.rs:678:20:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Issue description

In the example code, both the re-use of the 'empty' dataframe and the call to collect_schema seem to be needed to break the collect call.

Expected behavior

Without the call to collect_schema, the code works as expected. It should work the same way with the call to collect_schema in place.

Installed versions

>>> pl.show_versions()
--------Version info---------
Polars:               1.5.0
Index type:           UInt32
Platform:             Linux-6.1.84-99.169.amzn2023.x86_64-x86_64-with-glibc2.34
Python:               3.12.5 | packaged by conda-forge | (main, Aug  8 2024, 18:36:51) [GCC 12.4.0]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          <not installed>
connectorx:           <not installed>
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               <not installed>
gevent:               <not installed>
great_tables:         <not installed>
hvplot:               <not installed>
matplotlib:           <not installed>
nest_asyncio:         <not installed>
numpy:                <not installed>
openpyxl:             <not installed>
pandas:               <not installed>
pyarrow:              <not installed>
pydantic:             <not installed>
pyiceberg:            <not installed>
sqlalchemy:           <not installed>
torch:                <not installed>
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@da2225 da2225 added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Aug 14, 2024
@deanm0000 deanm0000 added P-medium Priority: medium A-panic Area: code that results in panic exceptions and removed needs triage Awaiting prioritization by a maintainer labels Aug 15, 2024
@github-project-automation github-project-automation bot moved this to Ready in Backlog Aug 15, 2024
@deanm0000
Copy link
Collaborator

This errors even if not empty for example

lf=pl.LazyFrame(dict(a=1))
lf.collect_schema()
pl.concat([lf, lf]).collect()

@github-project-automation github-project-automation bot moved this from Ready to Done in Backlog Aug 19, 2024
@c-peters c-peters added the accepted Ready for implementation label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-panic Area: code that results in panic exceptions accepted Ready for implementation bug Something isn't working P-medium Priority: medium python Related to Python Polars
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants