@@ -80,33 +80,18 @@ def test_getitem_ndarray_3d(self, index, obj, idxr, idxr_id):
80
80
idxr = idxr (obj )
81
81
nd3 = np .random .randint (5 , size = (2 , 2 , 2 ))
82
82
83
- msg = (
84
- r"Buffer has wrong number of dimensions \(expected 1, "
85
- r"got 3\)|"
86
- "Cannot index with multidimensional key|"
87
- r"Wrong number of dimensions. values.ndim != ndim \[3 != 1\]|"
88
- "Index data must be 1-dimensional"
83
+ msg = "|" .join (
84
+ [
85
+ r"Buffer has wrong number of dimensions \(expected 1, got 3\)" ,
86
+ "Cannot index with multidimensional key" ,
87
+ r"Wrong number of dimensions. values.ndim != ndim \[3 != 1\]" ,
88
+ "Index data must be 1-dimensional" ,
89
+ ]
89
90
)
90
91
91
- if (
92
- isinstance (obj , Series )
93
- and idxr_id == "getitem"
94
- and index .inferred_type
95
- in [
96
- "string" ,
97
- "datetime64" ,
98
- "period" ,
99
- "timedelta64" ,
100
- "boolean" ,
101
- "categorical" ,
102
- ]
103
- ):
92
+ with pytest .raises (ValueError , match = msg ):
104
93
with tm .assert_produces_warning (DeprecationWarning , check_stacklevel = False ):
105
94
idxr [nd3 ]
106
- else :
107
- with pytest .raises (ValueError , match = msg ):
108
- with tm .assert_produces_warning (DeprecationWarning ):
109
- idxr [nd3 ]
110
95
111
96
@pytest .mark .parametrize (
112
97
"index" , tm .all_index_generator (5 ), ids = lambda x : type (x ).__name__
0 commit comments