Skip to content

Commit 1def8d9

Browse files
committed
Add failing test
1 parent afcd780 commit 1def8d9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/tests/test_downstream.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import pandas as pd
1414
from pandas import (
1515
DataFrame,
16+
Index,
1617
Series,
1718
)
1819
import pandas._testing as tm
@@ -133,6 +134,21 @@ def test_xarray_cftimeindex_nearest():
133134
assert result == expected
134135

135136

137+
@td.skip_if_no("cftime")
138+
@td.skip_if_no("xarray")
139+
def test_xarray_cftimeindex_reset_index():
140+
import xarray
141+
142+
df = DataFrame(
143+
[[1, 2], [3, 4]],
144+
columns=xarray.cftime_range("0001", periods=2),
145+
index=Index(["hi", "bye"], name="string"),
146+
)
147+
# currently fails with TypeError
148+
res = df.reset_index()
149+
assert res.columns[0] == "string"
150+
151+
136152
def test_oo_optimizable():
137153
# GH 21071
138154
subprocess.check_call([sys.executable, "-OO", "-c", "import pandas"])

0 commit comments

Comments
 (0)