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

Timestamp parsing issue #1455

Closed
blaze225 opened this issue Jun 13, 2023 · 1 comment
Closed

Timestamp parsing issue #1455

blaze225 opened this issue Jun 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@blaze225
Copy link

Environment

Delta-rs version: 0.9.0

Binding: Python

Environment:

  • Cloud provider: Corporate S3 implementation based on Ceph
  • OS: Ubuntu

Bug

What happened:
Schema error for timestamp column when trying to create a delta table from a pyarrow dataframe, read from a csv file: deltalake.PyDeltaTableError: Schema error: Invalid data type for Delta Lake: Timestamp(Millisecond, Some("UTC"))

How to reproduce it:

  1. Have a csv file with a timestamp column with the format: 2023-05-11 18:00:00+03:00 (Timezone information explicitly mentioned)
  2. Read it using pyarrow: pyarrow.csv.read_csv(<file>)
  3. Try to write to a delta table: deltalake.write_deltalake(<path>, storage_options=<storage_options>)

More details:

  • Repeating the same with Pandas works without any issues.
  • Pyarrow parses it as timestamp[s, tz=UTC]
  • Pandas parses it as an Object
@blaze225 blaze225 added the bug Something isn't working label Jun 13, 2023
@wjones127
Copy link
Collaborator

wjones127 commented Jun 13, 2023

Hi @blaze225. Delta lake only supports microsecond timestamps, so you need to cast the datatype to the correct resolution.

We have an open issue to support automatic casting of timestamps and other common data types: #686

I'm going to close this issue as a duplicate of that one. This seems to be a high demand feature, so I'll see if we can get that issue prioritized.

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

2 participants