Skip to content

Commit cc75b68

Browse files
committed
CLN: tests.indexes.test_setop.py
1 parent fd67546 commit cc75b68

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

pandas/tests/indexes/test_setops.py

+14-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
Index,
1818
Int64Index,
1919
MultiIndex,
20-
RangeIndex,
2120
Series,
2221
TimedeltaIndex,
2322
Timestamp,
@@ -29,12 +28,10 @@
2928
pandas_dtype,
3029
)
3130

32-
COMPATIBLE_INCONSISTENT_PAIRS = {
33-
(Int64Index, RangeIndex): (tm.makeIntIndex, tm.makeRangeIndex),
34-
(Float64Index, Int64Index): (tm.makeFloatIndex, tm.makeIntIndex),
35-
(Float64Index, RangeIndex): (tm.makeFloatIndex, tm.makeIntIndex),
36-
(Float64Index, UInt64Index): (tm.makeFloatIndex, tm.makeUIntIndex),
37-
}
31+
COMPATIBLE_INCONSISTENT_PAIRS = [
32+
(np.float64, np.int64),
33+
(np.float64, np.uint64),
34+
]
3835

3936

4037
def test_union_same_types(index):
@@ -51,7 +48,7 @@ def test_union_different_types(index_flat, index_flat2):
5148
idx1 = index_flat
5249
idx2 = index_flat2
5350

54-
type_pair = tuple(sorted([type(idx1), type(idx2)], key=lambda x: str(x)))
51+
type_pair = tuple(sorted([idx1.dtype.type, idx2.dtype.type], key=lambda x: str(x)))
5552

5653
# Union with a non-unique, non-monotonic index raises error
5754
# This applies to the boolean index
@@ -80,7 +77,15 @@ def test_union_different_types(index_flat, index_flat2):
8077
raise NotImplementedError
8178

8279

83-
@pytest.mark.parametrize("idx_fact1,idx_fact2", COMPATIBLE_INCONSISTENT_PAIRS.values())
80+
@pytest.mark.parametrize(
81+
"idx_fact1,idx_fact2",
82+
[
83+
(tm.makeIntIndex, tm.makeRangeIndex),
84+
(tm.makeFloatIndex, tm.makeIntIndex),
85+
(tm.makeFloatIndex, tm.makeRangeIndex),
86+
(tm.makeFloatIndex, tm.makeUIntIndex),
87+
],
88+
)
8489
def test_compatible_inconsistent_pairs(idx_fact1, idx_fact2):
8590
# GH 23525
8691
idx1 = idx_fact1(10)

0 commit comments

Comments
 (0)