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

pyarrow DictionaryArray as partition column for write_deltalake fails #2969

Open
jorritsandbrink opened this issue Nov 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jorritsandbrink
Copy link

Environment

Delta-rs version: 0.21.0

Binding: python

Environment: local, WSL2, Ubuntu 24.04.1 LTS


Bug

What happened:
_internal.DeltaError: Generic DeltaTable error: Missing partition column: failed to parse when using pyarrow DictionaryArray as partition column for write_deltalake.

What you expected to happen:
Successful write.

How to reproduce it:

import pyarrow as pa
from deltalake import write_deltalake

# pyarrow.lib.DictionaryArray
array = pa.array(["a", "b", "c"], type=pa.dictionary(pa.int8(), pa.string()))

data = {
    "foo": [1, 2, 3],
    "bar": [1, 2, 3],
    "baz": array,
    # "baz": ["a", "b", "c"],  # using this instead works
}
table = pa.table(data)

# write to partitioned delta table
write_deltalake("my_delta_table", table, partition_by="baz")

# _internal.DeltaError: Generic DeltaTable error: Missing partition column: failed to parse

More details:

Traceback (most recent call last):
  File "/home/j/repos/dlt/mre.py", line 16, in <module>
    write_deltalake("my_delta_table", table, partition_by="baz")
  File "/home/j/.cache/pypoetry/virtualenvs/dlt-2tG_aB2A-py3.9/lib/python3.9/site-packages/deltalake/writer.py", line 323, in write_deltalake
    write_deltalake_rust(
_internal.DeltaError: Generic DeltaTable error: Missing partition column: failed to parse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant