-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
BUG: HDFStore doesn't save datetime64[s] right #59004
Comments
caballerofelipe
added
Bug
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
Jun 13, 2024
caballerofelipe
changed the title
BUG: HDFStore doesn't save datetime[s] right
BUG: HDFStore doesn't save datetime64[s] right
Jun 13, 2024
caballerofelipe
added a commit
to caballerofelipe/simple_portfolio_ledger
that referenced
this issue
Jun 13, 2024
…s]`. Some testing was done and a bug was filed, HDF5Store doesn't save or loads `datetime64[s]` right so it was changed to [ns] which is the format Pandas chooses when transforming to datetime. See the link for the bug: pandas-dev/pandas#59004 .
5 tasks
I think this is a bug in Just for reference, here is a trace stack I used for debugging the reproducible code:
|
lithomas1
added
IO HDF5
read_hdf, HDFStore
Non-Nano
datetime64/timedelta64 with non-nanosecond resolution
and removed
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
Jun 17, 2024
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When saving to a file using .h5 (HDF5 format), if a column is of type
datetime64[s]
(s not ns) and then loading the file, the date isn't loaded correctly. My intuition tells me that the file gets saved todatetime64[s]
but when read Pandas parses the date asdatetime64[ns]
and I guess some more digits should be present if parsing todatetime64[ns]
. I haven't done any tests with other datetime precisions.Expected Behavior
When saving a
datetime64[s]
to HDF5 file format and loading that file, the date should be correctly loaded.Installed Versions
The text was updated successfully, but these errors were encountered: