From 20b375ad0b50aaaa3fcf55257772b510d93f219b Mon Sep 17 00:00:00 2001 From: Vijayant Date: Tue, 29 Oct 2019 08:22:46 -0700 Subject: [PATCH] Adding test for assert_equal_index with empty iterables (#29211) * Adding test for assert_equal_index with empty iterables * Adding issue # in comment * formatted file using black * Move test to indexes/multi/test_constructor.py --- pandas/tests/indexes/multi/test_constructor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandas/tests/indexes/multi/test_constructor.py b/pandas/tests/indexes/multi/test_constructor.py index ff98da85cfb2d..c32adf275ac98 100644 --- a/pandas/tests/indexes/multi/test_constructor.py +++ b/pandas/tests/indexes/multi/test_constructor.py @@ -722,3 +722,10 @@ def test_from_frame_invalid_names(names, expected_error_msg): ) with pytest.raises(ValueError, match=expected_error_msg): pd.MultiIndex.from_frame(df, names=names) + + +def test_index_equal_empty_iterable(): + # #16844 + a = MultiIndex(levels=[[], []], codes=[[], []], names=["a", "b"]) + b = MultiIndex.from_arrays(arrays=[[], []], names=["a", "b"]) + tm.assert_index_equal(a, b)