Skip to content

Commit fdb0ce7

Browse files
committed
Address stacklevel request from Tom
1 parent 0051281 commit fdb0ce7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/core/arrays/categorical.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def from_codes(cls, codes, categories, ordered=False):
639639
err = False
640640
codes = icodes
641641
warn("float codes will be disallowed in the future",
642-
FutureWarning)
642+
FutureWarning, stacklevel=2)
643643
else:
644644
err = True
645645
if err:

pandas/tests/categorical/test_constructors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ def test_from_codes_with_float(self):
476476
codes = [1.0, 2.0, 0] # integer, but in float dtype
477477
categories = ['a', 'b', 'c']
478478

479-
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
479+
with tm.assert_produces_warning(FutureWarning):
480480
Categorical.from_codes(codes, categories)
481481

482482
codes = [1.1, 2.0, 0] # non-integer

0 commit comments

Comments
 (0)