-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
BUG: merge between partial index and index fails when result is empty #34414
Conversation
…result is empty with inner
� Conflicts: � doc/source/whatsnew/v1.1.0.rst
� Conflicts: � doc/source/whatsnew/v1.1.0.rst
� Conflicts: � doc/source/whatsnew/v1.2.0.rst
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. |
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.
@phofl if you can merge master will have a look
doc/source/whatsnew/v1.2.0.rst
Outdated
@@ -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`) |
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.
move to 1.3
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.
Done
� Conflicts: � doc/source/whatsnew/v1.2.0.rst � pandas/core/reshape/merge.py � pandas/tests/reshape/merge/test_merge.py
Done |
@@ -2375,3 +2375,15 @@ def test_merge_right_left_index(): | |||
} | |||
) | |||
tm.assert_frame_equal(result, expected) | |||
|
|||
|
|||
def test_merge_empty_right_index_left_on(): |
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.
can you do the exact reverse as well and parameterize over it (e.g. left_index=True)
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.
We are already testing both cases, parametrization is not really feasible here because we have to switch the dataframes too.
Renamed the test.
@jreback green |
thanks @phofl |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
The Issue was caused when setting the name of an numpy array.