-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Surface NumPy FutureWarning about comparisons #26966
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
Conversation
Closes pandas-dev#22698 Specifically, see pandas-dev#22698 (comment)
Oh, I was a bit confused... This happens with IntegerArray In [7]: a = pd.array([1, None], dtype='Int64')
In [8]: a == 'a'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-8-3812dba97b6d> in <module>
----> 1 a == 'a'
~/sandbox/pandas/pandas/core/arrays/integer.py in cmp_method(self, other)
561 mask = self._mask | mask
562
--> 563 result[mask] = op_name == 'ne'
564 return result
565
TypeError: 'bool' object does not support item assignment So right now I don't think showing a warning here is useful. We could work around it I suppose? |
Codecov Report
@@ Coverage Diff @@
## master #26966 +/- ##
==========================================
- Coverage 91.87% 91.87% -0.01%
==========================================
Files 180 180
Lines 50746 50744 -2
==========================================
- Hits 46623 46621 -2
Misses 4123 4123
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26966 +/- ##
==========================================
- Coverage 91.87% 91.87% -0.01%
==========================================
Files 180 180
Lines 50746 50744 -2
==========================================
- Hits 46623 46621 -2
Misses 4123 4123
Continue to review full report at Codecov.
|
This reverts commit ba5cb55.
looks fine. do we need to catch / suppress this in any of our tests? |
I don’t think we hit this anywhere else. If we did the NumPy dev build would be failing. |
k thanks @TomAugspurger |
Closes #22698
Specifically, see
#22698 (comment).
I don't think we need to worry about the others in #22698 (comment) datetimearray and integer array. I couldn't reproduce the returning a scalar behavior with those.