Skip to content

Commit fb92f38

Browse files
DEPR: use DeprecationWarning for Categorical fastpath deprecation (#52589)
1 parent 3b39a10 commit fb92f38

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
@@ -381,7 +381,7 @@ def __init__(
381381
warnings.warn(
382382
"The 'fastpath' keyword in Categorical is deprecated and will "
383383
"be removed in a future version. Use Categorical.from_codes instead",
384-
FutureWarning,
384+
DeprecationWarning,
385385
stacklevel=find_stack_level(),
386386
)
387387
else:

pandas/tests/arrays/categorical/test_constructors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_fastpath_deprecated(self):
3636
codes = np.array([1, 2, 3])
3737
dtype = CategoricalDtype(categories=["a", "b", "c", "d"], ordered=False)
3838
msg = "The 'fastpath' keyword in Categorical is deprecated"
39-
with tm.assert_produces_warning(FutureWarning, match=msg):
39+
with tm.assert_produces_warning(DeprecationWarning, match=msg):
4040
Categorical(codes, dtype=dtype, fastpath=True)
4141

4242
def test_categorical_from_cat_and_dtype_str_preserve_ordered(self):

0 commit comments

Comments
 (0)