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

.load_with_datetime() is incorrectly rounding to nearest second #1967

Closed
echai58 opened this issue Dec 13, 2023 · 0 comments · Fixed by #1968
Closed

.load_with_datetime() is incorrectly rounding to nearest second #1967

echai58 opened this issue Dec 13, 2023 · 0 comments · Fixed by #1968
Labels
bug Something isn't working

Comments

@echai58
Copy link

echai58 commented Dec 13, 2023

Environment

Delta-rs version: 0.14.0

Binding: python


Bug

What happened:
When you call load_with_datetime, it calls datetime.timestamp(),

let target_ts = datetime.timestamp();
- which returns the number of seconds. This is incorrect, because the version history has millisecond granularity
created_time: Some(Utc::now().timestamp_millis()),
, so it will return the wrong version if you are trying to read/write at sub-second granularity.

What you expected to happen:
It should call datetime.timestamp_millis().

How to reproduce it:
Write a table, check the transaction time with .history(), and try to read the version as of something in in the same second, but with a greater milliseconds. It will return the incorrect version.

@echai58 echai58 added the bug Something isn't working label Dec 13, 2023
roeap added a commit that referenced this issue Dec 19, 2023
…ersion` (#1968)

# Description
Combines the two functions into one.

# Related Issue(s)
- closes #1910
- closes #1967

---------

Co-authored-by: Robert Pack <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant