DEPR: Remove legacy offsets by agraboso · Pull Request #13868 · pandas-dev/pandas (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation11 Commits1 Checks0 Files changed

Conversation

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

[ Show hidden characters]({{ revealButtonHref }})

agraboso

Follow-up to #13590. Remove legacy offset aliases that remained in pandas/tseries/frequencies.py: _period_alias_dictionary() and _period_alias_dict.

@jreback

@sinhrks

hmm, were these previously deprecated?

@agraboso

@jreback All the removed aliases raise a FutureWarning in 0.18.1 and a ValueError in master — at least when creating Period and PeriodIndex objects, as well as calling .asfreq() on them.

@jreback jreback added Period

Period data type

Compat

pandas objects compatability with Numpy or Python functions

labels

Aug 1, 2016

@jreback

@agraboso

@codecov-io

Current coverage is 85.22% (diff: 100%)

Merging #13868 into master will decrease coverage by 0.01%

@@ master #13868 diff @@

Files 140 140
Lines 50456 50398 -58
Methods 0 0
Messages 0 0
Branches 0 0

Powered by Codecov. Last update d4f95fd...25d932d

sinhrks

@@ -683,7 +683,6 @@ cdef class _Period(object):
if isinstance(freq, compat.string_types):
freq = freq.upper()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

@sinhrks

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.

pd.Period(ordinal=1, freq='SECONDLY')
# Period('1970-01-01 00:00:01', 'S')

@agraboso

Follow-up to GH13590. Remove legacy offset aliases that remain in pandas/tseries/frequencies.py: _period_alias_dictionary() and _period_alias_dict

@agraboso

@sinhrks pd.Period(ordinal=1, freq='SECONDLY') raises a FutureWarning in 0.18.1. I added a test of pd.Period(ordinal=1, freq='SECONDLY') (and other removed aliases) that fails on master but passes with this PR.

@sinhrks

@agraboso You're right, confirmed using 0.18.1 to show warning.

@jreback

jreback pushed a commit that referenced this pull request

Aug 8, 2016

@agraboso @jreback

Author: agraboso agraboso@gmail.com

Closes #13874 from agraboso/fix-13730 and squashes the following commits:

49a3783 [agraboso] BUG: Fix Period and PeriodIndex support of combined alias offsets

Labels

Compat

pandas objects compatability with Numpy or Python functions

Frequency

DateOffsets

Period

Period data type