Skip to content

Commit 49b8c74

Browse files
committed
CLN: Remove some dtype methods from API
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.
1 parent 62a15fa commit 49b8c74

File tree

4 files changed

+6
-26
lines changed

4 files changed

+6
-26
lines changed

doc/source/whatsnew/v0.24.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,7 @@ Removal of prior version deprecations/changes
954954
- :meth:`DataFrame.sortlevel` and :meth:`Series.sortlevel` have been removed (:issue:`15099`)
955955
- :meth:`SparseSeries.to_dense` has dropped the ``sparse_only`` parameter (:issue:`14686`)
956956
- :meth:`DataFrame.astype` and :meth:`Series.astype` have renamed the ``raise_on_error`` argument to ``errors`` (:issue:`14967`)
957+
- ``is_sequence``, ``is_any_int_dtype``, and ``is_floating_dtype`` have been removed from ``pandas.api.types`` (:issue:`16163`, :issue:`16189`)
957958

958959
.. _whatsnew_0240.performance:
959960

pandas/core/dtypes/api.py

-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# flake8: noqa
22

3-
import sys
4-
53
from .common import (pandas_dtype,
64
is_dtype_equal,
75
is_extension_type,
@@ -59,24 +57,3 @@
5957
is_list_like,
6058
is_hashable,
6159
is_named_tuple)
62-
63-
64-
# deprecated
65-
m = sys.modules['pandas.core.dtypes.api']
66-
67-
for t in ['is_any_int_dtype', 'is_floating_dtype', 'is_sequence']:
68-
69-
def outer(t=t):
70-
71-
def wrapper(arr_or_dtype):
72-
import warnings
73-
import pandas
74-
warnings.warn("{t} is deprecated and will be "
75-
"removed in a future version".format(t=t),
76-
FutureWarning, stacklevel=3)
77-
return getattr(pandas.core.dtypes.common, t)(arr_or_dtype)
78-
return wrapper
79-
80-
setattr(m, t, outer(t))
81-
82-
del sys, m, t, outer

pandas/core/dtypes/common.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -796,11 +796,11 @@ def is_dtype_union_equal(source, target):
796796
def is_any_int_dtype(arr_or_dtype):
797797
"""Check whether the provided array or dtype is of an integer dtype.
798798
799-
.. deprecated:: 0.20.0
800-
801799
In this function, timedelta64 instances are also considered "any-integer"
802800
type objects and will return True.
803801
802+
This function is internal and should not be exposed in the public API.
803+
804804
Parameters
805805
----------
806806
arr_or_dtype : array-like
@@ -1560,6 +1560,8 @@ def is_float_dtype(arr_or_dtype):
15601560
"""
15611561
Check whether the provided array or dtype is of a float dtype.
15621562
1563+
This function is internal and should not be exposed in the public API.
1564+
15631565
Parameters
15641566
----------
15651567
arr_or_dtype : array-like

pandas/tests/api/test_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TestTypes(Base):
2727
'is_list_like', 'is_hashable', 'is_array_like',
2828
'is_named_tuple',
2929
'pandas_dtype', 'union_categoricals', 'infer_dtype']
30-
deprecated = ['is_any_int_dtype', 'is_floating_dtype', 'is_sequence']
30+
deprecated = []
3131
dtypes = ['CategoricalDtype', 'DatetimeTZDtype',
3232
'PeriodDtype', 'IntervalDtype']
3333

0 commit comments

Comments
 (0)