Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 27ed0f2

Browse files
committed
test: move test_dataframe_melt_multiindex per PR feedback
1 parent b6dcfec commit 27ed0f2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/system/small/test_multiindex.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,3 +1503,15 @@ def test_count_empty_multiindex_columns(session):
15031503
assert count_df.shape == (0,)
15041504
assert count_df.index.nlevels == 2
15051505
assert list(count_df.index.names) == ["a", "b"]
1506+
1507+
1508+
def test_dataframe_melt_multiindex(session):
1509+
# Tests that `melt` operations via count do not cause MultiIndex drops in Arrow
1510+
df = pandas.DataFrame({"A": [1], "B": ["string"], "C": [3]})
1511+
df.columns = pandas.MultiIndex.from_tuples(
1512+
[("Group1", "A"), ("Group2", "B"), ("Group1", "C")]
1513+
)
1514+
bdf = session.read_pandas(df)
1515+
1516+
count_df = bdf.count().to_pandas()
1517+
assert count_df.shape[0] == 3

0 commit comments

Comments
 (0)