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

Adding test for assert_equal_index with empty iterables #29211

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pandas/tests/util/test_assert_index_equal.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,9 @@ def test_index_equal_category_mismatch(check_categorical):
assert_index_equal(idx1, idx2, check_categorical=check_categorical)
else:
assert_index_equal(idx1, idx2, check_categorical=check_categorical)


def test_index_equal_empty_iterable():
a = MultiIndex(levels=[[], []], codes=[[], []], names=['a', 'b'])
Copy link
Member

Choose a reason for hiding this comment

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

Reference issue as a comment right above.

b = MultiIndex.from_arrays(arrays=[[], []], names=['a', 'b'])
assert_index_equal(a, b)