Skip to content

Commit 69fb0d5

Browse files
committed
Address stacklevel request from Tom
1 parent b6e173b commit 69fb0d5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/core/arrays/categorical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ def from_codes(cls, codes, categories, ordered=False):
640640
err = False
641641
codes = icodes
642642
warn("float codes will be disallowed in the future",
643-
FutureWarning)
643+
FutureWarning, stacklevel=2)
644644
else:
645645
err = True
646646
if err:

pandas/tests/arrays/categorical/test_constructors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def test_from_codes_with_float(self):
480480
codes = [1.0, 2.0, 0] # integer, but in float dtype
481481
categories = ['a', 'b', 'c']
482482

483-
with tm.assert_produces_warning(FutureWarning, check_stacklevel=False):
483+
with tm.assert_produces_warning(FutureWarning):
484484
Categorical.from_codes(codes, categories)
485485

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

0 commit comments

Comments
 (0)