Skip to content

Commit eb775e6

Browse files
committed
API: expose dtypes in pandas.api.types
xref #16015 xref apache/arrow#585
1 parent 19fc8da commit eb775e6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pandas/api/types/__init__.py

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

33
from pandas.core.dtypes.api import * # noqa
4+
from pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype, PeriodDtype # noqa
45
from pandas.core.dtypes.concat import union_categoricals # noqa
56
from pandas._libs.lib import infer_dtype # noqa
67
del np # noqa

pandas/tests/api/test_types.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ 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', 'PeriodDtype']
3637

3738
def test_types(self):
3839

39-
self.check(types, self.allowed)
40+
self.check(types, self.allowed + self.dtypes)
4041

4142
def check_deprecation(self, fold, fnew):
4243
with tm.assert_produces_warning(DeprecationWarning):

0 commit comments

Comments
 (0)