-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Fix left join turning into outer join #19624
Conversation
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.
Could you also add a release note under bug fixes?
pandas/tests/frame/test_join.py
Outdated
@@ -31,6 +31,11 @@ def right(): | |||
return DataFrame({'b': [300, 100, 200]}, index=[3, 1, 2]) | |||
|
|||
|
|||
@pytest.fixture | |||
def right_non_unique(): |
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.
Why'd you make this a fixture? If it's only used in one place then I'd prefer it be defined where it's used.
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.
Well, the below test is just the bare minimum, I think test_join
needs to cover many more situations. But I will pull it into the method for now.
pandas/tests/frame/test_join.py
Outdated
|
||
def test_join_left_sequence_non_unique_index(left, right, right_non_unique): | ||
# left join sequence of dataframes with non-unique indices (issue #19607) | ||
joined = left.join([right_non_unique], how='left') |
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.
Could you also build the expected output and tm.assert_frame_equal
against that?
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.
That should definitely be possible
Codecov Report
@@ Coverage Diff @@
## master #19624 +/- ##
==========================================
+ Coverage 91.59% 91.62% +0.02%
==========================================
Files 150 150
Lines 48795 48798 +3
==========================================
+ Hits 44696 44711 +15
+ Misses 4099 4087 -12
Continue to review full report at Codecov.
|
git diff upstream/master -u -- "*.py" | flake8 --diff