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

dtype is upcasted silently in list.concat #15064

Open
2 tasks done
gab23r opened this issue Mar 14, 2024 · 0 comments
Open
2 tasks done

dtype is upcasted silently in list.concat #15064

gab23r opened this issue Mar 14, 2024 · 0 comments
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@gab23r
Copy link
Contributor

gab23r commented Mar 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
df = pl.DataFrame(dict(l = [[0,1,2,]]), schema={'l': pl.List(pl.UInt32)})
df.schema 
# OrderedDict([('l', List(UInt32))])

df.with_columns(pl.col('l').list.concat([3])).schema 
# OrderedDict([('l', List(Int64))])

Log output

No response

Issue description

Don't know if it is expected or it should be tag as feature request. But upcasting silently from AnyValue did not seem right to me in that case.

Expected behavior

Schema is unchanged or raise if the new value do not match the left data type

Installed versions

--------Version info---------
Polars:               0.20.15
Index type:           UInt32
Platform:             macOS-14.1.1-x86_64-i386-64bit
Python:               3.11.6 (v3.11.6:8b6ee5ba3b, Oct  2 2023, 11:18:21) [Clang 13.0.0 (clang-1300.0.29.30)]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          2.2.1
connectorx:           <not installed>
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               <not installed>
gevent:               <not installed>
hvplot:               <not installed>
matplotlib:           <not installed>
numpy:                1.26.2
openpyxl:             <not installed>
pandas:               2.1.4
pyarrow:              <not installed>
pydantic:             1.10.13
pyiceberg:            <not installed>
pyxlsb:               <not installed>
sqlalchemy:           2.0.25
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>```

</details>
@gab23r gab23r added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Mar 14, 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

No branches or pull requests

1 participant