Skip to content

Commit 3fa869e

Browse files
topper-123Terji Petersen
and
Terji Petersen
authored
DEPR: remove Int/Uint/Float64Index from pandas/tests/arrays (#50875)
Co-authored-by: Terji Petersen <[email protected]>
1 parent 1f1f645 commit 3fa869e

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

pandas/tests/arrays/categorical/test_constructors.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
timedelta_range,
3030
)
3131
import pandas._testing as tm
32-
from pandas.core.api import Int64Index
3332

3433

3534
class TestCategoricalConstructors:
@@ -74,7 +73,7 @@ def test_constructor_empty(self):
7473
tm.assert_index_equal(c.categories, expected)
7574

7675
c = Categorical([], categories=[1, 2, 3])
77-
expected = Int64Index([1, 2, 3])
76+
expected = Index([1, 2, 3], dtype=np.int64)
7877
tm.assert_index_equal(c.categories, expected)
7978

8079
def test_constructor_empty_boolean(self):

pandas/tests/arrays/integer/test_dtypes.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ def test_astype_nansafe():
6262

6363
@pytest.mark.parametrize("dropna", [True, False])
6464
def test_construct_index(all_data, dropna):
65-
# ensure that we do not coerce to Float64Index, rather
66-
# keep as Index
65+
# ensure that we do not coerce to different Index dtype or non-index
6766

6867
all_data = all_data[:10]
6968
if dropna:

pandas/tests/arrays/sparse/test_array.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import pandas as pd
99
from pandas import isna
1010
import pandas._testing as tm
11-
from pandas.core.api import Int64Index
1211
from pandas.core.arrays.sparse import (
1312
SparseArray,
1413
SparseDtype,
@@ -469,7 +468,7 @@ def test_dropna(fill_value):
469468
tm.assert_sp_array_equal(arr.dropna(), exp)
470469

471470
df = pd.DataFrame({"a": [0, 1], "b": arr})
472-
expected_df = pd.DataFrame({"a": [1], "b": exp}, index=Int64Index([1]))
471+
expected_df = pd.DataFrame({"a": [1], "b": exp}, index=pd.Index([1]))
473472
tm.assert_equal(df.dropna(), expected_df)
474473

475474

0 commit comments

Comments
 (0)