-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: GH41044 - test loc dict assig #41076
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
arredond
commented
Apr 21, 2021
- closes BUG: Inconsistend behaviour when assigning dict to df.loc #41044
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry: not sure if it's needed but happy to provide one given some guidelines
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.
Thx, minor comments
pandas/tests/indexing/test_loc.py
Outdated
@@ -2700,3 +2700,13 @@ def test_loc_setitem(self, string_series): | |||
string_series.loc[d2] = 6 | |||
assert string_series[d1] == 4 | |||
assert string_series[d2] == 6 | |||
|
|||
def test_loc_dict_assign(self): |
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.
Coudl you do something like test_loc_assign_dict_to_row. Maybe test would be better located in tests/frame/indexing but @jbrockmendel is the expert here
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.
Sure thing. Let me know if it needs moving and I'll follow through. Still pretty knew to Pandas' testing structure 😅
@phofl Any idea why the CI checks are failing? It doesn't seem related to the test I added but maybe I'm missing something |
…c_dict_assign_test
Did they fail because of a ResourceWarning? We have a flaky test, which fails sometimes |
Yep, that seemed to be the cause. Just pulling in changes from |
This test fails now and then, is more or less arbitrary |
thanks @arredond very nice! |