Skip to content
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

BUG: merge between partial index and index fails when result is empty #34414

Conversation

phofl
Copy link
Member

@phofl phofl commented May 27, 2020

The Issue was caused when setting the name of an numpy array.

@dsaxton dsaxton added Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels May 27, 2020
pandas/tests/reshape/merge/test_merge.py Outdated Show resolved Hide resolved
pandas/tests/reshape/merge/test_merge.py Outdated Show resolved Hide resolved
pandas/tests/reshape/merge/test_merge.py Outdated Show resolved Hide resolved
@phofl phofl requested a review from jreback May 30, 2020 10:54
pandas/tests/reshape/merge/test_merge.py Outdated Show resolved Hide resolved
pandas/tests/reshape/merge/test_merge.py Outdated Show resolved Hide resolved
doc/source/whatsnew/v1.1.0.rst Outdated Show resolved Hide resolved
pandas/core/reshape/merge.py Show resolved Hide resolved
@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Nov 18, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

@phofl if you can merge master will have a look

@@ -357,6 +357,7 @@ Reshaping
- Bug in :func:`union_indexes` where input index names are not preserved in some cases. Affects :func:`concat` and :class:`DataFrame` constructor (:issue:`13475`)
- Bug in func :meth:`crosstab` when using multiple columns with ``margins=True`` and ``normalize=True`` (:issue:`35144`)
- Bug in :meth:`DataFrame.agg` with ``func={'name':<FUNC>}`` incorrectly raising ``TypeError`` when ``DataFrame.columns==['Name']`` (:issue:`36212`)
- Fixed bug in :func:`merge` where an error was raised when performing an inner join with partial index and ``right_index`` when no overlap between indices (:issue:`33814`)
Copy link
Contributor

Choose a reason for hiding this comment

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

move to 1.3

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

� Conflicts:
�	doc/source/whatsnew/v1.2.0.rst
�	pandas/core/reshape/merge.py
�	pandas/tests/reshape/merge/test_merge.py
@phofl
Copy link
Member Author

phofl commented Jan 1, 2021

Done

@jreback jreback added this to the 1.3 milestone Jan 3, 2021
@@ -2375,3 +2375,15 @@ def test_merge_right_left_index():
}
)
tm.assert_frame_equal(result, expected)


def test_merge_empty_right_index_left_on():
Copy link
Contributor

Choose a reason for hiding this comment

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

can you do the exact reverse as well and parameterize over it (e.g. left_index=True)

Copy link
Member Author

Choose a reason for hiding this comment

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

We are already testing both cases, parametrization is not really feasible here because we have to switch the dataframes too.
Renamed the test.

@phofl phofl changed the title 33814 merge partial index and index fails empty result BUG: merge between partial index and index fails when result is empty Jan 3, 2021
@phofl
Copy link
Member Author

phofl commented Jan 3, 2021

@jreback green

@jreback jreback merged commit 08ff65f into pandas-dev:master Jan 3, 2021
@jreback
Copy link
Contributor

jreback commented Jan 3, 2021

thanks @phofl

@phofl phofl deleted the 33814_merge_partial_index_and_index_fails_empty_result branch January 3, 2021 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Reshaping Concat, Merge/Join, Stack/Unstack, Explode Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Merge between partial index and index fails if result is empty
4 participants