diff --git a/pandas/core/categorical.py b/pandas/core/categorical.py index 17435dfc48bde..530a3ecb5f378 100644 --- a/pandas/core/categorical.py +++ b/pandas/core/categorical.py @@ -5,3 +5,4 @@ FutureWarning, stacklevel=2) from pandas.core.arrays import Categorical # noqa +from pandas.core.dtypes.dtypes import CategoricalDtype # noqa diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index 4a10ed6e7402c..c20767b09178c 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -259,3 +259,8 @@ def test_categorical_move(self): with tm.assert_produces_warning(FutureWarning): from pandas.core.categorical import Categorical # noqa + + sys.modules.pop("pandas.core.categorical", None) + + with tm.assert_produces_warning(FutureWarning): + from pandas.core.categorical import CategoricalDtype # noqa