Skip to content

Commit 0f47bf9

Browse files
Terji PetersenTerji Petersen
Terji Petersen
authored and
Terji Petersen
committed
DEPR: don't make Index instantiate Int64/Uint64/Flaot64Index
1 parent ab5e8e2 commit 0f47bf9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pandas/tests/indexes/timedeltas/test_timedelta.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
)
1515
import pandas._testing as tm
1616
from pandas.core.arrays import TimedeltaArray
17-
from pandas.core.indexes.api import Int64Index
1817
from pandas.tests.indexes.datetimelike import DatetimeLike
1918

2019
randn = np.random.randn
@@ -56,7 +55,7 @@ def test_map(self):
5655

5756
f = lambda x: x.days
5857
result = rng.map(f)
59-
exp = Int64Index([f(x) for x in rng])
58+
exp = Index([f(x) for x in rng], dtype=np.int32)
6059
tm.assert_index_equal(result, exp)
6160

6261
def test_pass_TimedeltaIndex_to_index(self):
@@ -70,15 +69,16 @@ def test_pass_TimedeltaIndex_to_index(self):
7069

7170
def test_fields(self):
7271
rng = timedelta_range("1 days, 10:11:12.100123456", periods=2, freq="s")
73-
tm.assert_index_equal(rng.days, Index([1, 1], dtype="int64"))
72+
tm.assert_index_equal(rng.days, Index([1, 1], dtype=np.int32))
7473
tm.assert_index_equal(
7574
rng.seconds,
76-
Index([10 * 3600 + 11 * 60 + 12, 10 * 3600 + 11 * 60 + 13], dtype="int64"),
75+
Index([10 * 3600 + 11 * 60 + 12, 10 * 3600 + 11 * 60 + 13], dtype=np.int32),
7776
)
7877
tm.assert_index_equal(
79-
rng.microseconds, Index([100 * 1000 + 123, 100 * 1000 + 123], dtype="int64")
78+
rng.microseconds,
79+
Index([100 * 1000 + 123, 100 * 1000 + 123], dtype=np.int32),
8080
)
81-
tm.assert_index_equal(rng.nanoseconds, Index([456, 456], dtype="int64"))
81+
tm.assert_index_equal(rng.nanoseconds, Index([456, 456], dtype=np.int32))
8282

8383
msg = "'TimedeltaIndex' object has no attribute '{}'"
8484
with pytest.raises(AttributeError, match=msg.format("hours")):

0 commit comments

Comments
 (0)