File tree 2 files changed +4
-6
lines changed
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 13
13
AnyArrayLike ,
14
14
ArrayLike ,
15
15
)
16
+ from pandas .util ._exceptions import find_stack_level
16
17
17
18
from pandas .core .dtypes .common import (
18
19
is_array_like ,
@@ -375,7 +376,7 @@ def deprecate_ndim_indexing(result, stacklevel: int = 3):
375
376
"is deprecated and will be removed in a future "
376
377
"version. Convert to a numpy array before indexing instead." ,
377
378
FutureWarning ,
378
- stacklevel = stacklevel ,
379
+ stacklevel = find_stack_level () ,
379
380
)
380
381
381
382
Original file line number Diff line number Diff line change @@ -724,13 +724,10 @@ def test_engine_reference_cycle(self, simple_index):
724
724
assert len (gc .get_referrers (index )) == nrefs_pre
725
725
726
726
def test_getitem_2d_deprecated (self , simple_index ):
727
- # GH#30588
727
+ # GH#30588, GH#31479
728
728
idx = simple_index
729
729
msg = "Support for multi-dimensional indexing"
730
- check = not isinstance (idx , (RangeIndex , CategoricalIndex ))
731
- with tm .assert_produces_warning (
732
- FutureWarning , match = msg , check_stacklevel = check
733
- ):
730
+ with tm .assert_produces_warning (FutureWarning , match = msg ):
734
731
res = idx [:, None ]
735
732
736
733
assert isinstance (res , np .ndarray ), type (res )
You can’t perform that action at this time.
0 commit comments