We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
df = pl.DataFrame({ "a": [1,2,3] }) df = df.with_columns([ pl.col("a").cast(pl.List(pl.Int64)) ])
Please implement casting to pl.List from any dtype.
Casting to List works for any dtype.
-------Version info--------- Polars: 0.18.13 Index type: UInt32 Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 Python: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] ----Optional dependencies---- adbc_driver_sqlite: <not installed> cloudpickle: <not installed> connectorx: <not installed> deltalake: <not installed> fsspec: <not installed> matplotlib: <not installed> numpy: 1.25.2 pandas: <not installed> pyarrow: <not installed> pydantic: <not installed> sqlalchemy: <not installed> xlsx2csv: <not installed> xlsxwriter: <not installed>
The text was updated successfully, but these errors were encountered:
It seems that arrow2 does not supports cast PrimitiveArray to LargeList, but it supports cast this to List.
PrimitiveArray
LargeList
List
Sorry, something went wrong.
Ah, yeap.. We must implement that upstream.
FYI: I have just submitted a patch to upstream: jorgecarleitao/arrow2#1547.
Test result:
df = pl.DataFrame({ "a": [1,2,3] }) df = df.with_columns([ pl.col("a").cast(pl.List(pl.Int64)) ]) ┌───────────┐ │ a │ │ --- │ │ list[i64] │ ╞═══════════╡ │ [1] │ │ [2] │ │ [3] │ └───────────┘
Nice! I will merge it upstream. Then we can point to the latest commit once merged.
Successfully merging a pull request may close this issue.
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
Issue description
Please implement casting to pl.List from any dtype.
Expected behavior
Casting to List works for any dtype.
Installed versions
The text was updated successfully, but these errors were encountered: