Skip to content

Commit

Permalink
CLN: Remove some dtype methods from API (pandas-dev#23390)
Browse files Browse the repository at this point in the history
Removes the following from the public API:

* pandas.api.types.is_sequence
* pandas.api.types.is_any_int_dtype
* pandas.api.types.is_floating_dtype

xref pandas-devgh-16163.
xref pandas-devgh-16189.
  • Loading branch information
gfyoung authored and Pingviinituutti committed Feb 28, 2019
1 parent 967357e commit a6c1864
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.24.0.txt
Expand Up @@ -956,6 +956,7 @@ Removal of prior version deprecations/changes
- :meth:`DataFrame.sortlevel` and :meth:`Series.sortlevel` have been removed (:issue:`15099`)
- :meth:`SparseSeries.to_dense` has dropped the ``sparse_only`` parameter (:issue:`14686`)
- :meth:`DataFrame.astype` and :meth:`Series.astype` have renamed the ``raise_on_error`` argument to ``errors`` (:issue:`14967`)
- ``is_sequence``, ``is_any_int_dtype``, and ``is_floating_dtype`` have been removed from ``pandas.api.types`` (:issue:`16163`, :issue:`16189`)

.. _whatsnew_0240.performance:

Expand Down
23 changes: 0 additions & 23 deletions pandas/core/dtypes/api.py
@@ -1,7 +1,5 @@
# flake8: noqa

import sys

from .common import (pandas_dtype,
is_dtype_equal,
is_extension_type,
Expand Down Expand Up @@ -59,24 +57,3 @@
is_list_like,
is_hashable,
is_named_tuple)


# deprecated
m = sys.modules['pandas.core.dtypes.api']

for t in ['is_any_int_dtype', 'is_floating_dtype', 'is_sequence']:

def outer(t=t):

def wrapper(arr_or_dtype):
import warnings
import pandas
warnings.warn("{t} is deprecated and will be "
"removed in a future version".format(t=t),
FutureWarning, stacklevel=3)
return getattr(pandas.core.dtypes.common, t)(arr_or_dtype)
return wrapper

setattr(m, t, outer(t))

del sys, m, t, outer
6 changes: 4 additions & 2 deletions pandas/core/dtypes/common.py
Expand Up @@ -796,11 +796,11 @@ def is_dtype_union_equal(source, target):
def is_any_int_dtype(arr_or_dtype):
"""Check whether the provided array or dtype is of an integer dtype.
.. deprecated:: 0.20.0
In this function, timedelta64 instances are also considered "any-integer"
type objects and will return True.
This function is internal and should not be exposed in the public API.
Parameters
----------
arr_or_dtype : array-like
Expand Down Expand Up @@ -1560,6 +1560,8 @@ def is_float_dtype(arr_or_dtype):
"""
Check whether the provided array or dtype is of a float dtype.
This function is internal and should not be exposed in the public API.
Parameters
----------
arr_or_dtype : array-like
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/api/test_types.py
Expand Up @@ -27,7 +27,7 @@ class TestTypes(Base):
'is_list_like', 'is_hashable', 'is_array_like',
'is_named_tuple',
'pandas_dtype', 'union_categoricals', 'infer_dtype']
deprecated = ['is_any_int_dtype', 'is_floating_dtype', 'is_sequence']
deprecated = []
dtypes = ['CategoricalDtype', 'DatetimeTZDtype',
'PeriodDtype', 'IntervalDtype']

Expand Down

0 comments on commit a6c1864

Please sign in to comment.