diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index f41327a4a16ca..f037e14177fdb 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -381,7 +381,7 @@ def __init__( warnings.warn( "The 'fastpath' keyword in Categorical is deprecated and will " "be removed in a future version. Use Categorical.from_codes instead", - FutureWarning, + DeprecationWarning, stacklevel=find_stack_level(), ) else: diff --git a/pandas/tests/arrays/categorical/test_constructors.py b/pandas/tests/arrays/categorical/test_constructors.py index 46ff46fe84dd1..e6e829cdaf1c2 100644 --- a/pandas/tests/arrays/categorical/test_constructors.py +++ b/pandas/tests/arrays/categorical/test_constructors.py @@ -36,7 +36,7 @@ def test_fastpath_deprecated(self): codes = np.array([1, 2, 3]) dtype = CategoricalDtype(categories=["a", "b", "c", "d"], ordered=False) msg = "The 'fastpath' keyword in Categorical is deprecated" - with tm.assert_produces_warning(FutureWarning, match=msg): + with tm.assert_produces_warning(DeprecationWarning, match=msg): Categorical(codes, dtype=dtype, fastpath=True) def test_categorical_from_cat_and_dtype_str_preserve_ordered(self):