Repository navigation
Conversation
datetime64[s] values were divided by 1000 on their way to a TIMESTAMP_MILLIS column instead of multiplied, and timedelta64[s] values were stored as if already in microseconds. NaT is kept as NaT. Fixes dask#992
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #992.
Two unit errors in
writer.convertfor second-resolution columns:datetime64[s]is written asTIMESTAMP_MILLIS, but itstime_factorsentry was used as a divisor, so seconds were divided by 1000 instead of multiplied.2025-01-05was stored as1736035ms, which the reader then cannot cast back to seconds.timedelta64[s]fell through to the "already microseconds" branch and was stored as-is in theTIME_MICROScolumn, so90061s read back as 90061 µs (0 s at second resolution).Both now scale up, keeping NaT as NaT the way the existing
m8[ms]branch does.The new test fails without the change (both
has_nullscases); the rest of the suite is unchanged (386 passed, pandas 3.1.1). I also round-tripped datetimes and timedeltas at s/ms/us/ns, naive and withUTC/Europe/Paris, with and withoutpandas_nulls, including NaT, a negative timedelta and the epoch: all match.