Skip to content

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

Merged
merged 5 commits into from
Apr 21, 2021

Conversation

arredond
Copy link
Contributor

Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, minor comments

@@ -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):
Copy link
Member

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

Copy link
Contributor Author

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 😅

@arredond
Copy link
Contributor Author

@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

@phofl
Copy link
Member

phofl commented Apr 21, 2021

Did they fail because of a ResourceWarning?

We have a flaky test, which fails sometimes

@arredond
Copy link
Contributor Author

Yep, that seemed to be the cause. Just pulling in changes from master and pushing back to the PR and retriggering the tests seems to have fixed it

@phofl
Copy link
Member

phofl commented Apr 21, 2021

This test fails now and then, is more or less arbitrary

@jreback jreback added Indexing Related to indexing on series/frames, not to indexes themselves Testing pandas testing functions or related to the test suite labels Apr 21, 2021
@jreback jreback added this to the 1.3 milestone Apr 21, 2021
@jreback jreback merged commit 03e1019 into pandas-dev:master Apr 21, 2021
@jreback
Copy link
Contributor

jreback commented Apr 21, 2021

thanks @arredond very nice!

@arredond arredond deleted the loc_dict_assign_test branch April 21, 2021 22:52
yeshsurya pushed a commit to yeshsurya/pandas that referenced this pull request May 6, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Inconsistend behaviour when assigning dict to df.loc
3 participants