-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: Deprecate range-based PeriodIndex construction #24354
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: Deprecate range-based PeriodIndex construction #24354
Conversation
Hello @TomAugspurger! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on December 28, 2018 at 13:35 Hours UTC |
pandas/core/indexes/datetimes.py
Outdated
@@ -223,13 +239,13 @@ def __new__(cls, data=None, | |||
verify_integrity = True | |||
|
|||
if data is None: | |||
result = cls._generate_range(start, end, periods, |
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.
Previously, if you passed a bad set of arguments (e.g. forgot freq
), then we would warn and then raise an exception.
Well, that's unfortunate (on master) In [3]: pd.period_range(start='2000', periods=2)
Out[3]: PeriodIndex(['2000-01-01', '2000-01-02'], dtype='period[D]', freq='D')
In [4]: pd.PeriodIndex(start='2000', periods=2)
Out[4]: PeriodIndex(['2000', '2001'], dtype='period[A-DEC]', freq='A-DEC') |
Codecov Report
@@ Coverage Diff @@
## master #24354 +/- ##
===========================================
- Coverage 92.29% 43.01% -49.29%
===========================================
Files 162 162
Lines 51808 51812 +4
===========================================
- Hits 47817 22287 -25530
- Misses 3991 29525 +25534
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24354 +/- ##
==========================================
- Coverage 92.3% 92.3% -0.01%
==========================================
Files 163 163
Lines 51969 51980 +11
==========================================
+ Hits 47968 47978 +10
- Misses 4001 4002 +1
Continue to review full report at Codecov.
|
5473bf1 attempts to preserve the behavior of Question: This introduces a difference between
The latter will have freq |
Does anyone see the actual failure in https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=5567 My latest commit fixes some warnings... but I don't think that's what caused the failure. |
Ah, just search the log for "failed". The sparse get_dummies is timing out:
I must have messed something up... |
There's something strange going on with the series constructor... I'll open an issue soon. |
commit 6a65cbc Author: Tom Augspurger <[email protected]> Date: Thu Dec 20 07:21:34 2018 -0600 SparseSeries unstack commit b253674 Author: Tom Augspurger <[email protected]> Date: Thu Dec 20 06:40:44 2018 -0600 BUG: Fix concat(Series[sparse], axis=1) * Preserve sparsity * Preserve fill value commit ae026b2 Author: Tom Augspurger <[email protected]> Date: Wed Dec 19 21:21:12 2018 -0600 avoid series constructor (cherry picked from commit eb219ac) commit aa08a6d Author: Tom Augspurger <[email protected]> Date: Wed Dec 19 16:39:04 2018 -0600 Fixed warnings in asv files (cherry picked from commit f566b46)
This is now on top of #24372. Should be mergeable once that's in. |
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.
looks fine. should fix the test as I indicated, if you want to merge this and followup pls indicate.
thanks @TomAugspurger |
Closes #20535