-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Add Timedelta Support to JSON Reader with orient="table" #21140
Comments
I would like to work on this issue! |
Hello, should pd.Timedelta be used for parsing here? I mean, use it somewhere inside parse_table_schema? |
Yes IIRC correctly the limiting factor previously was that timedeltas are represented as ISO 8601 durations in the JSON table Schema, but when this was first built the Timedelta constructor would not parse that duration format as an argument. Since the PR in the original post that is no longer an issue so this should be possible to do now |
Now, if parse durations with Timedelta constructor in parse_table_schema, they get coerced into int64 after, in FrameParser from json.py(it seems that it tries to coerce floats without decimal digits). Is it expected behavior? Maybe their dtype should be changed from timedelta64 to timedelta64[ns]? |
Right now trying to parse JSON using orient='table' will fail if the object contains Timedeltas intentionally:
pandas/pandas/io/json/table_schema.py
Line 310 in bc37ea2
Since #19065 was merged I think this should now be possible if anyone wants to take a look
The text was updated successfully, but these errors were encountered: