-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
v0.15.1 breaks index set operations #9095
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
Comments
@jorisvandenbossche these warnings are correct (though I admit a bit confusing). Not sure how they got changed, but lots of moving parts. Numeric operations are fully operable (though not well tested). Index will warn on -/+. DatetimeIndex no warning at them moment (I guess should have been one). |
Further, the numeric were ALWAYS actual numeric operations (int/float index). So this is not an API break at all. |
Maybe I wasn't really clear (it is a large code chunk above), but:
this is a huge API change that we missed, in a minor release without any mention in the release notes. Or do I miss something? |
it was always like this (that's one reason I changed it), the set operations were just confusing. (with +/-) |
It is the other way around, no? It has always been set operation (see example above in 0.15.0, and I also checked in 0.14.1 and 0.13.1). That is why we put a deprecation in place. |
Possibly related to #8634? |
All of the ops with a scalar were actually numeric ops (and always have been), e.g. +,-,*,/. I suppose the set ops for Int64Index (for +/-) were there. No tests existed for anything else (Numeric Index, and stil dont today). If people were using it was undocumented behavior.
Not sure what you are proposing. I don't think this warrants anything. |
@jreback It may not have been explicitly listed, but I do think is strongly implied by even the current documentation. I do think this is a regression -- albeit untested and deprecated behavior. If we are going to release another bugfix release 0.15.3 in the near future, I think we should restore this. On the other hand, if it's going to be a few months until 0.16, we might just move on with the deprecation (though that is faster than usually desired). The good news is that at least 0.15.0 does include some warnings. If we are going to revert this and do a more gradual deprecation, we should not wait until February -- then we'll end up with users relying on the new behavior (in fact, this may already be an issue). |
@jreback I am not speaking about index - scalar operations, these indeed are and have always been numeric. But I am speaking about index - index operations ( We also used this feature within the pandas codebase (those have been adapted to union/difference). I myself for example used it in code for my daily work, but I did not yet used that code since 0.15.1, so I did not yet noticed it. |
ok, so an untested, partially documented behavior that was deprecated anyhow is a break. This is the reason fro tests (and it was specifically mentioned that this was untested). Keep in mind that an IntIndex and this is what is referred here, is Numeric in all other ways, e.g. multiplication with another index,ndarray (which is , the fix 'caused' this), and ops with scalars. No 0.15.3. @jorisvandenbossche if you really want to put a note in prior documentation, then go for it. So will make this issue for testing of these features. One of you pls put in place some tests for the non-Index, non-datetimelike indexes. I am going to make the #9094 issue into the change for DatetimeInde/PeriodIndex (as TimedeltaIndex) already does this (only for subtraction, + will have to raise a TypeError) |
It is true that the tests were not thorough enough, so we didn't catch this change in 0.15.1 (eg no real test for the deprecation itself, and only test for Index itself and not for all subclasses).
That is not really the point. I think we all agree that the set operations are a bit strange and confusing, as other operations (index with scalar/array, multiplication, ..) are all the 'normal' element-wise operations. We discussed that thoroughly in #8226, and we all agreed to change this behaviour, but decided to first give it a deprecation cycle. The question is a bit how 'severe' this break is, and I must say I can't really judge it. We did not yet receive any reports (which could suggest it is not used a lot), but on the other hand, I think a lot of people still have to update to >= 0.15.1. |
In 0.15.0, the
-
index set operation raises a warning as is explained in the whatsnew docs: http://pandas.pydata.org/pandas-docs/stable/whatsnew.html#deprecationsBut in 0.15.1:
So
Index
object itself) it raises the warningAnd the same on master (and 0.15.2)
The text was updated successfully, but these errors were encountered: