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.
gh-109798: Normalize
_datetime
anddatetime
error messages #127345New 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
gh-109798: Normalize
_datetime
anddatetime
error messages #127345Changes from all commits
764eb1b
2bf419f
4363e9e
9da0dfc
179423d
f691251
d8973cf
5eea62f
79543cc
d174497
498c4ba
216d0fe
c409fec
3f454f6
a2b8f7a
209c338
0777aa5
4d31d33
f05ebba
f840105
61c95a5
2ab77b3
b1e272a
7a35bd4
cfd18cb
2827514
cd3bdc1
9915dfe
1da5a3a
610f067
410e0ce
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not going to be a great user experience here because of how bad the
timedelta
formatter is:Maybe it will be clearer if we do it this way:
That will print stuff like
-1 day, 1:00:00
instead oftimedelta(days=-2, seconds=82800)
. Though looking at it, I realize that the way it gets printed is misleading, since that's the output you get fromprint(timedelta(hours=-23))
and users have no way of knowing what is going on under the hood there.Probably a more elaborate timedelta formatter would be better, since we basically always want this in
HH:MM:SS.fff
format, since that reflects what we care about best and also is unambigous, but we don't have a particularly easy way to do that. I guess we can revisit this when/if #85426 is implemented.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pganssle
Okay, then let's solve this issue in a separate PR linked to that issue (I can send the changes soon).
I think this one can be merged for now and I would be glad if you review another PR #127242 for
datetime
module :)