From 8bacfdd808429a69549dcd3b0a1e555b3153bc74 Mon Sep 17 00:00:00 2001 From: gfyoung Date: Sat, 27 Oct 2018 16:00:23 -0700 Subject: [PATCH] CLN: Cleanup toplevel namespace shims 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 9a781eda0e3974..4df4e82c408bd5 100644 --- a/doc/source/whatsnew/v0.24.0.txt +++ b/doc/source/whatsnew/v0.24.0.txt @@ -943,6 +943,7 @@ Removal of prior version deprecations/changes - Strings passed into :meth:`DataFrame.groupby` that refer to both column and index levels will raise a ``ValueError`` (:issue:`14432`) - :meth:`Index.repeat` and :meth:`MultiIndex.repeat` have renamed the ``n`` argument to ``repeats`` (:issue:`14645`) - 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`) - :meth:`Categorical.searchsorted` and :meth:`Series.searchsorted` have renamed the ``v`` argument to ``value`` (:issue:`14645`) - :meth:`TimedeltaIndex.searchsorted`, :meth:`DatetimeIndex.searchsorted`, and :meth:`PeriodIndex.searchsorted` have renamed the ``key`` argument to ``value`` (:issue:`14645`) diff --git a/pandas/computation/__init__.py b/pandas/computation/__init__.py deleted file mode 100644 index e69de29bb2d1d6..00000000000000 diff --git a/pandas/computation/expressions.py b/pandas/computation/expressions.py deleted file mode 100644 index d194cd2404c9d9..00000000000000 --- 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 1a234cdfe3518c..65c5f4991780fa 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -193,20 +193,6 @@ def test_deprecation_access_func(self): pd.tslib.Timestamp('20160101') -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 e69de29bb2d1d6..00000000000000 diff --git a/pandas/types/common.py b/pandas/types/common.py deleted file mode 100644 index a125c27d045967..00000000000000 --- 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 477156b38d56d8..00000000000000 --- 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 54bb834e829f31..00000000000000 --- 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