Skip to content

Allow to union MultiIndex with empty RangeIndex #41275

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 10 commits into from
May 4, 2021

Conversation

mlondschien
Copy link
Contributor

See also dask/dask#7610 and JDASoftwareGroup/kartothek#464. The regression seems to have been introduced in #38671.

@@ -414,6 +414,14 @@ def test_union_empty_self_different_names():
tm.assert_index_equal(result, expected)


def test_union_multiindex_empty_rangeindex():
# GH#41234
mi = MultiIndex.from_arrays([[1, 2], [3, 4]], names=["a", "b"])
Copy link
Contributor

Choose a reason for hiding this comment

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

test the reverse also

@@ -754,6 +754,7 @@ Indexing
- Bug in :meth:`DataFrame.loc.__setitem__` when setting-with-expansion incorrectly raising when the index in the expanding axis contains duplicates (:issue:`40096`)
- Bug in :meth:`DataFrame.loc` incorrectly matching non-boolean index elements (:issue:`20432`)
- Bug in :meth:`Series.__delitem__` with ``ExtensionDtype`` incorrectly casting to ``ndarray`` (:issue:`40386`)
- Bug in :meth:`MultiIndex.union` raising for an empty ``RangeIndex`` (:issue:`41234`)
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a bug vc 1.2.x? if not then no whatsnew is needed (instead add this issue number next to the other release note)

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.

also i see that the actual issue is showing with concat; can u add a test for that as well

@jreback jreback added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label May 3, 2021
@jreback jreback added this to the 1.3 milestone May 4, 2021
@jreback jreback added the Bug label May 4, 2021
@jreback jreback merged commit 30dd641 into pandas-dev:master May 4, 2021
@jreback
Copy link
Contributor

jreback commented May 4, 2021

thanks @mlondschien

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: concatenating MultiIndex with empty RangeIndex raises
3 participants