Skip to content

Commit a4709e2

Browse files
jrebackpcluo
authored andcommitted
API: expose dtypes in pandas.api.types (pandas-dev#16099)
* API: expose dtypes in pandas.api.types xref pandas-dev#16015 xref apache/arrow#585 xref pandas-dev#16042 xref pandas-dev#15541 (comment)
1 parent 3c144f8 commit a4709e2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pandas/api/types/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
""" public toolkit API """
22

33
from pandas.core.dtypes.api import * # noqa
4+
from pandas.core.dtypes.dtypes import (CategoricalDtype, # noqa
5+
DatetimeTZDtype,
6+
PeriodDtype,
7+
IntervalDtype)
48
from pandas.core.dtypes.concat import union_categoricals # noqa
59
from pandas._libs.lib import infer_dtype # noqa
610
del np # noqa

pandas/tests/api/test_types.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ class TestTypes(Base, tm.TestCase):
3333
'is_list_like', 'is_hashable',
3434
'is_named_tuple', 'is_sequence',
3535
'pandas_dtype', 'union_categoricals', 'infer_dtype']
36+
dtypes = ['CategoricalDtype', 'DatetimeTZDtype',
37+
'PeriodDtype', 'IntervalDtype']
3638

3739
def test_types(self):
3840

39-
self.check(types, self.allowed)
41+
self.check(types, self.allowed + self.dtypes)
4042

4143
def check_deprecation(self, fold, fnew):
4244
with tm.assert_produces_warning(DeprecationWarning):

0 commit comments

Comments
 (0)