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

exceptions.ArrowErrorException: NotYetImplemented("Casting from ... to LargeList(Field { ... not supported") #10611

Closed
2 tasks done
wKollendorf opened this issue Aug 19, 2023 · 4 comments · Fixed by #10623
Closed
2 tasks done
Labels
bug Something isn't working python Related to Python Polars

Comments

@wKollendorf
Copy link

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

df = pl.DataFrame({
	"a": [1,2,3]
})

df = df.with_columns([
	pl.col("a").cast(pl.List(pl.Int64))
])

Issue description

Please implement casting to pl.List from any dtype.

Expected behavior

Casting to List works for any dtype.

Installed versions

-------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>
@wKollendorf wKollendorf added bug Something isn't working python Related to Python Polars labels Aug 19, 2023
@reswqa
Copy link
Collaborator

reswqa commented Aug 19, 2023

It seems that arrow2 does not supports cast PrimitiveArray to LargeList, but it supports cast this to List.

@ritchie46
Copy link
Member

Ah, yeap.. We must implement that upstream.

@reswqa
Copy link
Collaborator

reswqa commented Aug 20, 2023

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]       │
└───────────┘

@ritchie46
Copy link
Member

Nice! I will merge it upstream. Then we can point to the latest commit once merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Related to Python Polars
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants