-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Operations with SparseArray return SA with wrong indices #45125
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
Have you added a test for #45110? |
I've added 12 test for comparison with scalars. Bug that you've caught consist from two operations mask array and comparison with scalar. In previous version SparseArray operators was tested via Series. Now it's not. And I decided that exactly such combined test is redundant. |
When you close issues, you should always add tests ensuring, that they do not pop again |
Ok, let me add it |
@phofl if you can have a look |
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.
Not really familiar with SparseArrays, but some small comments
@jbrockmendel if you can have a look |
@@ -26,6 +26,8 @@ def mix(request): | |||
return request.param | |||
|
|||
|
|||
# FIXME: There are not SparseArray tests. There are numpy array tests. |
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.
IIUC these are SparseArray tests just not useful ones bc they don't have non-trivial indexes? if correct, can you clarify this for future readers
@jbrockmendel ok here? |
LGTM. @bdrum is there a gameplan for the two xfailed tests? |
ok merging this and can followup with the failed ones, @bdrum if you can create an issue for those, PR would be great as well :-> |
@meeseeksdev backport 1.4.x |
… SA with wrong indices
Something went wrong ... Please have a look at my logs. |
@jbrockmendel I think so. Comparisons with arrays still work wrong, I'll try to fix it. |
…rong indices (#45275) Co-authored-by: Boris Rumyantsev <[email protected]>
Two tests have failed but looks like the reason is not my changes
(Perhaps won't see in checks)
====================================================================== FAILURES =======================================================================
__________________________________________ TestChaining.test_detect_chained_assignment_warning_stacklevel[3] __________________________________________
self = <pandas.tests.indexing.test_chaining_and_caching.TestChaining object at 0x0000022FC3FBFB80>, rhs = 3
E AssertionError: assert 'c:\Users\b...nd_caching.py' == 'C:\Users\b...nd_caching.py'
E - C:\Users\bdrum\Development\python\pandas\pandas\tests\indexing\test_chaining_and_caching.py
E ? ^
E + c:\Users\bdrum\Development\python\pandas\pandas\tests\indexing\test_chaining_and_caching.py
E ? ^
pandas\tests\indexing\test_chaining_and_caching.py:444: AssertionError
------------------------------------- generated xml file: C:\Users\bdrum\Development\python\pandas\test-data.xml --------------------------------------
================================================================ slowest 30 durations =================================================================
0.29s call pandas/tests/indexing/test_chaining_and_caching.py::TestChaining::test_detect_chained_assignment_warning_stacklevel[3]
(2 durations < 0.005s hidden. Use -vv to show these durations.)
=============================================================== short test summary info ===============================================================
FAILED pandas/tests/indexing/test_chaining_and_caching.py::TestChaining::test_detect_chained_assignment_warning_stacklevel[3] - AssertionError: asser...
========================================================== 1 failed, 31 deselected in 0.84s ===========================================================
This is only part of solutiion in order to close regression. I will create separate issue that describes global SparseArray indices problem.
Current behavior as expected in #45110