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

Delta Lake Duration data type #17836

Open
2 tasks done
gam-phon opened this issue Jul 24, 2024 · 0 comments
Open
2 tasks done

Delta Lake Duration data type #17836

gam-phon opened this issue Jul 24, 2024 · 0 comments
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@gam-phon
Copy link
Contributor

gam-phon commented Jul 24, 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
from datetime import timedelta

data1 = [
    {"d": timedelta(days=2), "k": "ds"},
]
df = pl.DataFrame(data1)
df.write_delta("delta_lake")

Log output

File ".venv/lib/python3.12/site-packages/polars/dataframe/frame.py", line 4066, in write_delta
write_deltalake(
File ".venv/lib/python3.12/site-packages/deltalake/writer.py", line 543, in write_deltalake
write_deltalake_pyarrow(
_internal.SchemaMismatchError: Invalid data type for Delta Lake: Duration(Microsecond)

Issue description

In the documentation we did not mention that duration is not supported.
In docs it is written
The Polars data types :class:`Null` and :class:`Time` are not supported by the delta protocol specification and will raise a TypeError.

mentioned in this comment #16454 (comment) @ion-elgreco

Expected behavior

Maybe write in the documentation. we do not support duration, since it is not supported yet by delta or we work around it by serialization/deserialization like what is proposed in the link

Installed versions

Replace this line with the output of pl.show_versions(). Leave the backticks in place.

polars 1.2.1

@gam-phon gam-phon added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Jul 24, 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