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

Panic when doing an invalid melt #17078

Closed
2 tasks done
kszlim opened this issue Jun 19, 2024 · 2 comments · Fixed by #17088
Closed
2 tasks done

Panic when doing an invalid melt #17078

kszlim opened this issue Jun 19, 2024 · 2 comments · Fixed by #17088
Assignees
Labels
accepted Ready for implementation bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@kszlim
Copy link
Contributor

kszlim commented Jun 19, 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

pl.LazyFrame({"a": ["x","y"], "b": [["test", "test2"], ["test3", "test4"]]}).melt().collect()

Log output

PanicException: called `Result::unwrap()` on an `Err` value: InvalidOperation(ErrString("cannot cast List type (inner: 'String', to: 'String')"))

Issue description

Shouldn't panic, but perhaps should throw SchemaException?

Expected behavior

Shouldn't panic, but perhaps should throw SchemaException?

Installed versions

--------Version info---------
Polars:               1.0.0-beta.1
Index type:           UInt32
Platform:             Linux-5.10.218-186.862.x86_64-x86_64-with-glibc2.26
Python:               3.11.7 (main, Dec  5 2023, 22:00:36) [GCC 7.3.1 20180712 (Red Hat 7.3.1-17)]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          3.0.0
connectorx:           <not installed>
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               2024.5.0
gevent:               <not installed>
great_tables:         0.7.0
hvplot:               <not installed>
matplotlib:           3.8.4
nest_asyncio:         1.6.0
numpy:                1.26.4
openpyxl:             <not installed>
pandas:               2.2.2
pyarrow:              16.1.0
pydantic:             2.7.2
pyiceberg:            <not installed>
sqlalchemy:           <not installed>
torch:                <not installed>
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>```

</details>
@kszlim kszlim added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Jun 19, 2024
@kszlim kszlim changed the title Panic when doing an invalid? melt Panic when doing an invalid melt Jun 19, 2024
@ravikanthreddy89
Copy link

@kszlim output on my machine (Mac M2, Python 3.11.7, Polars 0.20.31)

Screenshot 2024-06-19 at 3 26 15 PM

@kszlim
Copy link
Contributor Author

kszlim commented Jun 19, 2024

You're on an older version, also it's not clear if that type unification makes sense.

@ritchie46 ritchie46 self-assigned this Jun 20, 2024
@c-peters c-peters added the accepted Ready for implementation label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants