From 1ac9b259d9513f37cda6ee832d7a814940002bf9 Mon Sep 17 00:00:00 2001 From: gfyoung Date: Sun, 28 Oct 2018 06:40:23 -0700 Subject: [PATCH] CLN: Cleanup toplevel namespace shims (#23386) Removes the following: * pandas.types * pandas.computation * pandas.util.decorators xref gh-16157. xref gh-16250. --- doc/source/whatsnew/v0.24.0.txt | 1 + pandas/computation/__init__.py | 0 pandas/computation/expressions.py | 15 --------------- pandas/tests/api/test_api.py | 14 -------------- pandas/types/__init__.py | 0 pandas/types/common.py | 8 -------- pandas/types/concat.py | 11 ----------- pandas/util/decorators.py | 8 -------- 8 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 pandas/computation/__init__.py delete mode 100644 pandas/computation/expressions.py delete mode 100644 pandas/types/__init__.py delete mode 100644 pandas/types/common.py delete mode 100644 pandas/types/concat.py delete mode 100644 pandas/util/decorators.py diff --git a/doc/source/whatsnew/v0.24.0.txt b/doc/source/whatsnew/v0.24.0.txt index 11e3a73cd8c30..9ebcaeed32240 100644 --- a/doc/source/whatsnew/v0.24.0.txt +++ b/doc/source/whatsnew/v0.24.0.txt @@ -944,6 +944,7 @@ Removal of prior version deprecations/changes - :meth:`Index.repeat` and :meth:`MultiIndex.repeat` have renamed the ``n`` argument to ``repeats`` (:issue:`14645`) - The ``Series`` constructor and ``.astype`` method will now raise a ``ValueError`` if timestamp dtypes are passed in without a frequency (e.g. ``np.datetime64``) for the ``dtype`` parameter (:issue:`15987`) - Removal of the previously deprecated ``as_indexer`` keyword completely from ``str.match()`` (:issue:`22356`, :issue:`6581`) +- The modules ``pandas.types``, ``pandas.computation``, and ``pandas.util.decorators`` have been removed (:issue:`16157`, :issue:`16250`) - Removed the ``pandas.formats.style`` shim for :class:`pandas.io.formats.style.Styler` (:issue:`16059`) - :func:`pandas.pnow`, :func:`pandas.match`, :func:`pandas.groupby`, :func:`pd.get_store`, ``pd.Expr``, and ``pd.Term`` have been removed (:issue:`15538`, :issue:`15940`) - :meth:`Categorical.searchsorted` and :meth:`Series.searchsorted` have renamed the ``v`` argument to ``value`` (:issue:`14645`) diff --git a/pandas/computation/__init__.py b/pandas/computation/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/pandas/computation/expressions.py b/pandas/computation/expressions.py deleted file mode 100644 index d194cd2404c9d..0000000000000 --- a/pandas/computation/expressions.py +++ /dev/null @@ -1,15 +0,0 @@ -import warnings - - -def set_use_numexpr(v=True): - """ - .. deprecated:: 0.20.0 - Use ``pandas.set_option('compute.use_numexpr', v)`` instead. - """ - warnings.warn("pandas.computation.expressions.set_use_numexpr is " - "deprecated and will be removed in a future version.\n" - "you can toggle usage of numexpr via " - "pandas.get_option('compute.use_numexpr')", - FutureWarning, stacklevel=2) - from pandas import set_option - set_option('compute.use_numexpr', v) diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index bb544d2ee81fd..fef87c9e6c4c2 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -135,20 +135,6 @@ def test_TimeGrouper(self): pd.TimeGrouper(freq='D') -class TestTypes(object): - - def test_deprecation_access_func(self): - with tm.assert_produces_warning( - FutureWarning, check_stacklevel=False): - from pandas.types.concat import union_categoricals - c1 = pd.Categorical(list('aabc')) - c2 = pd.Categorical(list('abcd')) - union_categoricals( - [c1, c2], - sort_categories=True, - ignore_order=True) - - class TestCDateRange(object): def test_deprecation_cdaterange(self): diff --git a/pandas/types/__init__.py b/pandas/types/__init__.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/pandas/types/common.py b/pandas/types/common.py deleted file mode 100644 index a125c27d04596..0000000000000 --- a/pandas/types/common.py +++ /dev/null @@ -1,8 +0,0 @@ -import warnings - -warnings.warn("pandas.types.common is deprecated and will be " - "removed in a future version, import " - "from pandas.api.types", - DeprecationWarning, stacklevel=3) - -from pandas.core.dtypes.common import * # noqa diff --git a/pandas/types/concat.py b/pandas/types/concat.py deleted file mode 100644 index 477156b38d56d..0000000000000 --- a/pandas/types/concat.py +++ /dev/null @@ -1,11 +0,0 @@ -import warnings - - -def union_categoricals(to_union, sort_categories=False, ignore_order=False): - warnings.warn("pandas.types.concat.union_categoricals is " - "deprecated and will be removed in a future version.\n" - "use pandas.api.types.union_categoricals", - FutureWarning, stacklevel=2) - from pandas.api.types import union_categoricals - return union_categoricals( - to_union, sort_categories=sort_categories, ignore_order=ignore_order) diff --git a/pandas/util/decorators.py b/pandas/util/decorators.py deleted file mode 100644 index 54bb834e829f3..0000000000000 --- a/pandas/util/decorators.py +++ /dev/null @@ -1,8 +0,0 @@ -import warnings - -warnings.warn("pandas.util.decorators is deprecated and will be " - "removed in a future version, import " - "from pandas.util", - DeprecationWarning, stacklevel=3) - -from pandas.util._decorators import * # noqa