-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DEPR: 'epoch' date format in to_json #57987
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
Changes from 3 commits
339b2e0
41156fd
8fee0ea
80cd7fe
5300d7e
f59aa80
9938eb5
75df145
f9c39b4
36d3cf4
50d6d99
8e4b95c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2328,6 +2328,11 @@ def to_json( | |
'iso' = ISO8601. The default depends on the `orient`. For | ||
``orient='table'``, the default is 'iso'. For all other orients, | ||
the default is 'epoch'. | ||
|
||
.. deprecated:: 2.2.2 | ||
Aloqeely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'epoch' date format is deprecated and will be removed in a future | ||
version, please use 'iso' instead. | ||
|
||
double_precision : int, default 10 | ||
The number of decimal places to use when encoding | ||
floating point values. The possible maximal value is 15. | ||
|
@@ -2530,6 +2535,14 @@ def to_json( | |
date_format = "iso" | ||
elif date_format is None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think need to warn for anything that is not currently There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also add a warning for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry to be more specific we need to warn when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @WillAyd curious how would users get the old behavior? It would be good to add that in the warning message There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The old behavior as in just an integer? I think the problem with that is it was an implementation detail of pandas spilling out into the JSON serializer. Historically our timestamps were exclusively nanoseconds since the Unix epoch, but with all the work @jbrockmendel has been doing that is no longer true (and _usually not true). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah. Just checking if we can still offer a suggestion for a migration path if they want to keep the old behavior There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so. Especially with our auto-inferencing of resolutions I don't see how it would be usable at all roundtripping through JSON There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK sounds good |
||
date_format = "epoch" | ||
elif date_format == "epoch": | ||
# GH#57063 | ||
warnings.warn( | ||
"'Epoch' date format is deprecated and will be removed in a future " | ||
Aloqeely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"version, please use 'iso' date format instead.", | ||
FutureWarning, | ||
stacklevel=find_stack_level(), | ||
) | ||
|
||
config.is_nonnegative_int(indent) | ||
indent = indent or 0 | ||
|
Uh oh!
There was an error while loading. Please reload this page.