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

Error using extension types in struct in PyArrow #44853

Open
stemillington-flock opened this issue Nov 25, 2024 · 0 comments
Open

Error using extension types in struct in PyArrow #44853

stemillington-flock opened this issue Nov 25, 2024 · 0 comments

Comments

@stemillington-flock
Copy link

Describe the bug, including details regarding any error messages, version, and platform.

The following code runs without problem

from pyarrow import schema, struct, field
from pyarrow import uuid

schema([
        field("col", uuid())
]).empty_table()

However when i try to move the uuid column into a struct as below

schema([
    field("parent", struct([
        field("col", uuid())
    ]))
]).empty_table()

I get the error

ArrowNotImplementedError                  Traceback (most recent call last)
Cell In[77], [line 5](vscode-notebook-cell:?execution_count=77&line=5)
      [1](vscode-notebook-cell:?execution_count=77&line=1) schema([
      [2](vscode-notebook-cell:?execution_count=77&line=2)     field("parent", struct([
      [3](vscode-notebook-cell:?execution_count=77&line=3)         field("col", uuid())
      [4](vscode-notebook-cell:?execution_count=77&line=4)     ]))
----> [5](vscode-notebook-cell:?execution_count=77&line=5) ]).empty_table()

File ~/Code/map-matching/.venv/lib/python3.12/site-packages/pyarrow/types.pxi:2988, in pyarrow.lib.Schema.empty_table()

File ~/Code/map-matching/.venv/lib/python3.12/site-packages/pyarrow/array.pxi:4791, in pyarrow.lib._empty_array()

File ~/Code/map-matching/.venv/lib/python3.12/site-packages/pyarrow/array.pxi:370, in pyarrow.lib.array()

File ~/Code/map-matching/.venv/lib/python3.12/site-packages/pyarrow/array.pxi:42, in pyarrow.lib._sequence_to_array()

File ~/Code/map-matching/.venv/lib/python3.12/site-packages/pyarrow/error.pxi:155, in pyarrow.lib.pyarrow_internal_check_status()

File ~/Code/map-matching/.venv/lib/python3.12/site-packages/pyarrow/error.pxi:92, in pyarrow.lib.check_status()

ArrowNotImplementedError: extension

This appears to happen when any extension type is moved into a struct. Using pyarrow 18.0.0 on a mac book pro M2.

Component(s)

Python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant