-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
DEPR: Remove legacy offsets #13868
DEPR: Remove legacy offsets #13868
Conversation
hmm, were these previously deprecated? |
@jreback All the removed aliases raise a |
The are a few tests — see, for example,
But I don't know if there may be some edge cases in which the removed aliases could be accepted. |
Current coverage is 85.22% (diff: 100%)@@ master #13868 diff @@
==========================================
Files 140 140
Lines 50456 50398 -58
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 43007 42950 -57
+ Misses 7449 7448 -1
Partials 0 0
|
@@ -683,7 +683,6 @@ cdef class _Period(object): | |||
|
|||
if isinstance(freq, compat.string_types): | |||
freq = freq.upper() |
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.
can we remove .upper
also, because it is handled in get_offset
(called from to_offset
)?
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.
Removed.
Yes it has been missed as not tested. Thanks for the catch! NOTE: I found a condition which doesn't show warning. I think it is rare and can't be a reason to keep the impl, but may need discussion.
|
Follow-up to GH13590. Remove legacy offset aliases that remain in `pandas/tseries/frequencies.py`: `_period_alias_dictionary()` and `_period_alias_dict`
@sinhrks |
@agraboso You're right, confirmed using 0.18.1 to show warning. |
thanks! |
- [x] closes #13730 - [x] tests added / passed - [x] passes ``git diff upstream/master | flake8 --diff`` - [x] whatsnew entry Essentially, makes sure any `freq` string passed to a `Period` or `PeriodIndex` goes through [`_Period._maybe_convert_freq()`](https://g ithub.com/pydata/pandas/blob/master/pandas/src/period.pyx#L682-L697), which calls [`to_offset()`](https://github.com/pydata/pandas/blob/mast er/pandas/tseries/frequencies.py#L389-L451), which is where the logic for combining aliases is. All the examples in #13730 result in the correct output, and all existing tests pass. I have not written any new ones yet — I first wanted to get the opinion of the maintainers. This PR builds on #13868 (without it, some existing tests fail). Author: agraboso <[email protected]> Closes #13874 from agraboso/fix-13730 and squashes the following commits: 49a3783 [agraboso] BUG: Fix Period and PeriodIndex support of combined alias offsets
git diff upstream/master | flake8 --diff
Follow-up to #13590. Remove legacy offset aliases that remained in
pandas/tseries/frequencies.py
:_period_alias_dictionary()
and_period_alias_dict
.