|
4 | 4 | from pandas.compat import (string_types, text_type, binary_type, |
5 | 5 | PY3, PY36) |
6 | 6 | from pandas._libs import algos, lib |
7 | | -from pandas._libs.tslibs import conversion, Period |
| 7 | +from pandas._libs.tslibs import conversion, Period, Timestamp |
| 8 | +from pandas._libs.interval import Interval |
8 | 9 |
|
9 | 10 | from pandas.core.dtypes.dtypes import ( |
10 | 11 | registry, CategoricalDtype, CategoricalDtypeType, DatetimeTZDtype, |
11 | | - DatetimeTZDtypeType, PeriodDtype, IntervalDtype, |
12 | | - IntervalDtypeType, PandasExtensionDtype, ExtensionDtype, |
| 12 | + PeriodDtype, IntervalDtype, |
| 13 | + PandasExtensionDtype, ExtensionDtype, |
13 | 14 | _pandas_registry) |
14 | 15 | from pandas.core.dtypes.generic import ( |
15 | 16 | ABCCategorical, ABCPeriodIndex, ABCDatetimeIndex, ABCSeries, |
@@ -1903,20 +1904,20 @@ def _get_dtype_type(arr_or_dtype): |
1903 | 1904 | elif isinstance(arr_or_dtype, CategoricalDtype): |
1904 | 1905 | return CategoricalDtypeType |
1905 | 1906 | elif isinstance(arr_or_dtype, DatetimeTZDtype): |
1906 | | - return DatetimeTZDtypeType |
| 1907 | + return Timestamp |
1907 | 1908 | elif isinstance(arr_or_dtype, IntervalDtype): |
1908 | | - return IntervalDtypeType |
| 1909 | + return Interval |
1909 | 1910 | elif isinstance(arr_or_dtype, PeriodDtype): |
1910 | | - return arr_or_dtype.type |
| 1911 | + return Period |
1911 | 1912 | elif isinstance(arr_or_dtype, string_types): |
1912 | 1913 | if is_categorical_dtype(arr_or_dtype): |
1913 | 1914 | return CategoricalDtypeType |
1914 | 1915 | elif is_datetime64tz_dtype(arr_or_dtype): |
1915 | | - return DatetimeTZDtypeType |
| 1916 | + return Timestamp |
1916 | 1917 | elif is_period_dtype(arr_or_dtype): |
1917 | 1918 | return Period |
1918 | 1919 | elif is_interval_dtype(arr_or_dtype): |
1919 | | - return IntervalDtypeType |
| 1920 | + return Interval |
1920 | 1921 | return _get_dtype_type(np.dtype(arr_or_dtype)) |
1921 | 1922 | try: |
1922 | 1923 | return arr_or_dtype.dtype.type |
|
0 commit comments