Skip to content

Commit

Permalink
CLN: Remove some dtype methods from API
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 committed Oct 27, 2018
1 parent da9d851 commit 8110871
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
23 changes: 0 additions & 23 deletions pandas/core/dtypes/api.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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 8110871

Please sign in to comment.