API/DEPR: Remove +/- as setops for DatetimeIndex/PeriodIndex (GH9630) by jorisvandenbossche · Pull Request #14164 · 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
Conversation18 Commits3 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 }})
Some todo's:
- still have to further clean-up the tests a bit (due to the previous API the tests for set ops and numeric ops are a bit mixed)
- need to add some more test cases for DTI - DTI (eg with NaNs)
- for subtraction of two
PeriodIndex
objects, this is currently raising a TypeError, but I think we could actually allow it? Although that maybe depends on what is decided in ENH/API: Decide what to return Period - Period subtraction #13077
I think these should be the last remaining set ops as numeric ops that are now removed with this PR.
we need to wait for #13077 on Period-Period
(so can discuss over there). Let's limit scope to the more useful DTI-DTI
rng3 = pd.date_range('1/1/2000', freq='D', periods=5, tz=tz) |
---|
other3 = pd.DatetimeIndex([], tz=tz) |
expected3 = pd.date_range('1/1/2000', freq='D', periods=5, tz=tz) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test subtracting different lengths (ValueError) IIRC; this maybe already tested in another section though
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mean this for below (dti-dti)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a test for that (and added code to give this a nicer error message)
Current coverage is 85.25% (diff: 96.55%)
@@ master #14164 diff @@
Files 139 139
Lines 50496 50512 +16
Methods 0 0
Messages 0 0
Branches 0 0
- Hits 43049 43064 +15
- Misses 7447 7448 +1
Partials 0 0
Powered by Codecov. Last update 8023029...21c6cec
Previous Behavior: |
Previous behavior: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to standardize here, I see @jorisvandenbossche and @sinhrks changing these!
IIRC I think we do more of Previous Behavior
(e.g. capitalized), and american spelling (no Behaviour
). But should just pick one :)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, will do that in #14176
We indeed need to just make a choice between American or British :-)
(is capitalizing all words also an American habit? :-))
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 2 capital words sets it off s bit more
using American spelling
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while proofreading the whatsnew, I was thinking of putting the 'New/Old Behavior' in bold, that also sets it off a bit more
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even better
trbs added a commit to trbs/pandas that referenced this pull request
…eter
- github.com:pydata/pandas: (554 commits) BUG: compat with Stata ver 111 Fix: F999 dictionary key '2000q4' repeated with different values (pandas-dev#14198) BLD: Test for Python 3.5 with C locale BUG: DatetimeTZBlock can't assign values near dst boundary BUG: union_categorical with Series and cat idx BUG: fix str.contains for series containing only nan values BUG: Categorical constructor not idempotent with ext dtype TST: Make encoded sep check more locale sensitive (pandas-dev#14161) DOC: minor typo in 0.19.0 whatsnew file (pandas-dev#14185) BUG: fix tz-aware datetime convert to DatetimeIndex (GH 14088) BUG : bug in setting a slice of a Series with a np.timedelta64 RLS: v0.19.0rc1 DOC: clean-up 0.19.0 whatsnew file (pandas-dev#14176) DOC: cleanup build warnings (pandas-dev#14172) Add steps to run gbq integration testing to the contributing docs (pandas-dev#14144) ENH: concat and append now can handle unordered categories (pandas-dev#13767) DEPR: Deprecate pandas.core.datetools (pandas-dev#14105) API/DEPR: Remove +/- as setops for DatetimeIndex/PeriodIndex (GH9630) (pandas-dev#14164) Fix trivial typo in comment (pandas-dev#14174) API/DEPR: Remove +/- as setops for Index (GH8227) (pandas-dev#14127) ...
trbs added a commit to trbs/pandas that referenced this pull request
- github.com:pydata/pandas: (554 commits) BUG: compat with Stata ver 111 Fix: F999 dictionary key '2000q4' repeated with different values (pandas-dev#14198) BLD: Test for Python 3.5 with C locale BUG: DatetimeTZBlock can't assign values near dst boundary BUG: union_categorical with Series and cat idx BUG: fix str.contains for series containing only nan values BUG: Categorical constructor not idempotent with ext dtype TST: Make encoded sep check more locale sensitive (pandas-dev#14161) DOC: minor typo in 0.19.0 whatsnew file (pandas-dev#14185) BUG: fix tz-aware datetime convert to DatetimeIndex (GH 14088) BUG : bug in setting a slice of a Series with a np.timedelta64 RLS: v0.19.0rc1 DOC: clean-up 0.19.0 whatsnew file (pandas-dev#14176) DOC: cleanup build warnings (pandas-dev#14172) Add steps to run gbq integration testing to the contributing docs (pandas-dev#14144) ENH: concat and append now can handle unordered categories (pandas-dev#13767) DEPR: Deprecate pandas.core.datetools (pandas-dev#14105) API/DEPR: Remove +/- as setops for DatetimeIndex/PeriodIndex (GH9630) (pandas-dev#14164) Fix trivial typo in comment (pandas-dev#14174) API/DEPR: Remove +/- as setops for Index (GH8227) (pandas-dev#14127) ...