-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DEPR: depreecate uppercase units 'MIN', 'MS', 'US', 'NS' in Timedelta and 'to_timedelta' #57700
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
Closed
natmokval
wants to merge
7
commits into
pandas-dev:main
from
natmokval:depr-uppercase-units-min-ms-ns-us
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
96f0b94
correct def parse_timedelta_unit, add tests, fix test
natmokval 34e2169
add deprecated units to c_DEPR_ABBREVS
natmokval 53cbb78
Merge branch 'main' into depr-uppercase-units-min-ms-ns-us
natmokval c42376b
fix cython-lint error
natmokval b16c72f
remove 'MS' from c_DEPR_ABBREVS
natmokval ee7ef36
Merge branch 'main' into depr-uppercase-units-min-ms-ns-us
natmokval a53a00d
add a note to v3.0.0, update Timedelta docstring
natmokval File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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.
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.
Instead of adding another branch is there any reason to not just add these to
c_DEPR_ABBREVS
?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.
thank you, I agree, better to add these deprecated units to the dictionary. I made the changes.
Unfortunately, we can't add
"MS"
toc_DEPR_ABBREVS
because we use that dictionary in the definition ofto_offset
, and in thus casee"MS"
means"MonthBegin"
. ForTimedelta
, "ms" means milliseconds, so we want to deprecate "MS" for"Milli"
to avoid confusion.I wonder, can we get these changes into
2.2.x
? The reason: we deprecated already uppercase strings“MIN”, “MS”, “US”, and “NS”
denoting frequencies forPeriod
andoffsets
in favor of lowercase strings.Seems like CI failures aren't related to my changes.
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.
sorry I might have missed something but where was this discussed? I don't remember it now. "month begin" isn't valid for timedelta, so I think there's no risk of confusion here?
there's already 2.2.0 and 2.2.1 out, I think it's too late now
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.
As discussed: by
you meant "deprecate "MS" for milliseconds", not
as I'd interpreted it
All good then 👍
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.
yeah, my wording wasn't clear enough. I meant:
deprecate "MS" for milliseconds"
.I updated
Timedelta
docstring, and added a note tov3.0.0
, but I am unsure if we need the note, because using uppercase strings“MIN”, “MS”, “US”, “NS”
for units are not documented.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.
same as in the other PR, shall we mark this as draft until we've enfored the existing deprecations, so that the codebase can get a little cleaner?
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.
thanks, sounds reasonable, I marked this PR as draft.