Skip to content

Commit

Permalink
API: expose dtypes in pandas.api.types (#16099)
Browse files Browse the repository at this point in the history
* API: expose dtypes in pandas.api.types

xref #16015
xref apache/arrow#585
xref #16042
xref #15541 (comment)
  • Loading branch information
jreback committed Apr 24, 2017
1 parent e8edf13 commit 844013b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pandas/api/types/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
""" public toolkit API """

from pandas.core.dtypes.api import * # noqa
from pandas.core.dtypes.dtypes import (CategoricalDtype, # noqa
DatetimeTZDtype,
PeriodDtype,
IntervalDtype)
from pandas.core.dtypes.concat import union_categoricals # noqa
from pandas._libs.lib import infer_dtype # noqa
del np # noqa
4 changes: 3 additions & 1 deletion pandas/tests/api/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ class TestTypes(Base, tm.TestCase):
'is_list_like', 'is_hashable',
'is_named_tuple', 'is_sequence',
'pandas_dtype', 'union_categoricals', 'infer_dtype']
dtypes = ['CategoricalDtype', 'DatetimeTZDtype',
'PeriodDtype', 'IntervalDtype']

def test_types(self):

self.check(types, self.allowed)
self.check(types, self.allowed + self.dtypes)

def check_deprecation(self, fold, fnew):
with tm.assert_produces_warning(DeprecationWarning):
Expand Down

0 comments on commit 844013b

Please sign in to comment.