Skip to content

Commit 844ab1b

Browse files
Terji PetersenTerji Petersen
Terji Petersen
authored and
Terji Petersen
committed
DEPR: don't make Index instantiate Int64/Uint64/Flaot64Index
1 parent 3714e85 commit 844ab1b

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

pandas/conftest.py

-3
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,7 @@ def _create_mi_with_dt64tz_level():
593593
"datetime-tz": tm.makeDateIndex(100, tz="US/Pacific"),
594594
"period": tm.makePeriodIndex(100),
595595
"timedelta": tm.makeTimedeltaIndex(100),
596-
"int": tm.makeIntIndex(100),
597-
"uint": tm.makeUIntIndex(100),
598596
"range": tm.makeRangeIndex(100),
599-
"float": tm.makeFloatIndex(100),
600597
"complex64": tm.makeFloatIndex(100).astype("complex64"),
601598
"complex128": tm.makeFloatIndex(100).astype("complex128"),
602599
"num_int64": tm.makeNumericIndex(100, dtype="int64"),

pandas/tests/arrays/interval/test_interval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def test_arrow_array():
287287
with pytest.raises(TypeError, match="Not supported to convert IntervalArray"):
288288
pa.array(intervals, type="float64")
289289

290-
with pytest.raises(TypeError, match="different 'subtype'"):
290+
with pytest.raises(TypeError, match="Not supported to convert IntervalArray"):
291291
pa.array(intervals, type=ArrowIntervalType(pa.float64(), "left"))
292292

293293

pandas/tests/arrays/sparse/test_accessor.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ def test_from_coo(self):
4141
sp_array = scipy.sparse.coo_matrix((data, (row, col)), dtype="int")
4242
result = pd.Series.sparse.from_coo(sp_array)
4343

44-
index = pd.MultiIndex.from_arrays([[0, 0, 1, 3], [0, 2, 1, 3]])
44+
index = pd.MultiIndex.from_arrays(
45+
[
46+
np.array([0, 0, 1, 3], dtype=np.int32),
47+
np.array([0, 2, 1, 3], dtype=np.int32),
48+
],
49+
)
4550
expected = pd.Series([4, 9, 7, 5], index=index, dtype="Sparse[int]")
4651
tm.assert_series_equal(result, expected)
4752

@@ -212,7 +217,15 @@ def test_series_from_coo(self, dtype, dense_index):
212217

213218
A = scipy.sparse.eye(3, format="coo", dtype=dtype)
214219
result = pd.Series.sparse.from_coo(A, dense_index=dense_index)
215-
index = pd.MultiIndex.from_tuples([(0, 0), (1, 1), (2, 2)])
220+
221+
index_dtype = np.int64 if dense_index else np.int32
222+
index = pd.MultiIndex.from_tuples(
223+
[
224+
np.array([0, 0], dtype=index_dtype),
225+
np.array([1, 1], dtype=index_dtype),
226+
np.array([2, 2], dtype=index_dtype),
227+
],
228+
)
216229
expected = pd.Series(SparseArray(np.array([1, 1, 1], dtype=dtype)), index=index)
217230
if dense_index:
218231
expected = expected.reindex(pd.MultiIndex.from_product(index.levels))

0 commit comments

Comments
 (0)