diff --git a/pandas/__init__.py b/pandas/__init__.py index 83ad85e3e292b..529750cd97076 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -60,11 +60,15 @@ # extension module deprecations from pandas.util.depr_module import _DeprecatedModule -json = _DeprecatedModule(deprmod='pandas.json', deprmodto='pandas.io.json.libjson') -parser = _DeprecatedModule(deprmod='pandas.parser', deprmodto='pandas.io.libparsers') +json = _DeprecatedModule(deprmod='pandas.json', + moved={'dumps': 'pandas.io.json.dumps', + 'loads': 'pandas.io.json.loads'}) +parser = _DeprecatedModule(deprmod='pandas.parser', + removals=['na_values'], + moved={'CParserError': 'pandas.errors.ParserError'}) lib = _DeprecatedModule(deprmod='pandas.lib', deprmodto='pandas._libs.lib', moved={'infer_dtype': 'pandas.api.lib.infer_dtype'}) -tslib = _DeprecatedModule(deprmod='pandas.tslib', deprmodto='pandas._libs.tslib', +tslib = _DeprecatedModule(deprmod='pandas.tslib', moved={'Timestamp': 'pandas.Timestamp', 'Timedelta': 'pandas.Timedelta', 'NaT': 'pandas.NaT', diff --git a/pandas/tslib.py b/pandas/tslib.py index 3d96dc496c0de..f7d99538c2ea2 100644 --- a/pandas/tslib.py +++ b/pandas/tslib.py @@ -2,7 +2,6 @@ import warnings warnings.warn("The pandas.tslib module is deprecated and will be " - "removed in a future version. Please import from " - "the pandas or pandas.errors instead", FutureWarning, stacklevel=2) + "removed in a future version.", FutureWarning, stacklevel=2) from pandas._libs.tslib import (Timestamp, Timedelta, NaT, OutOfBoundsDatetime) diff --git a/pandas/util/depr_module.py b/pandas/util/depr_module.py index 0885c81ce2757..1f428198c19f3 100644 --- a/pandas/util/depr_module.py +++ b/pandas/util/depr_module.py @@ -68,7 +68,7 @@ def __getattr__(self, name): elif self.moved is not None and name in self.moved: warnings.warn( "{deprmod} is deprecated and will be removed in " - "a future version.\nYou can access {name} in {moved}".format( + "a future version.\nYou can access {name} as {moved}".format( deprmod=self.deprmod, name=name, moved=self.moved[name]),