diff --git a/pandas/util/__init__.py b/pandas/util/__init__.py index a462080f328f4..4d5ef69a7ecfa 100644 --- a/pandas/util/__init__.py +++ b/pandas/util/__init__.py @@ -9,14 +9,29 @@ def __getattr__(key: str): return hash_pandas_object if key == "Appender": + import warnings + + from pandas.errors import Pandas4Warning from pandas.util._decorators import Appender + warnings.warn( + "Appender is deprecated and will be removed in a future version.", + Pandas4Warning, + stacklevel=2, + ) return Appender if key == "Substitution": + import warnings + + from pandas.errors import Pandas4Warning from pandas.util._decorators import Substitution + warnings.warn( + "Substitution is deprecated and will be removed in a future version.", + Pandas4Warning, + stacklevel=2, + ) return Substitution - if key == "cache_readonly": from pandas.util._decorators import cache_readonly