@@ -907,9 +907,9 @@ def _get_dtype_from_object(dtype):
907
907
if isinstance (dtype , type ) and issubclass (dtype , np .generic ):
908
908
return dtype
909
909
elif is_categorical (dtype ):
910
- return CategoricalDtype ().type
910
+ return gt . CategoricalDtype ().type
911
911
elif is_datetimetz (dtype ):
912
- return DatetimeTZDtype (dtype ).type
912
+ return gt . DatetimeTZDtype (dtype ).type
913
913
elif isinstance (dtype , np .dtype ): # dtype object
914
914
try :
915
915
_validate_date_like_dtype (dtype )
@@ -1465,9 +1465,9 @@ def is_datetimelike(arr):
1465
1465
def _coerce_to_dtype (dtype ):
1466
1466
""" coerce a string / np.dtype to a dtype """
1467
1467
if is_categorical_dtype (dtype ):
1468
- dtype = CategoricalDtype ()
1468
+ dtype = gt . CategoricalDtype ()
1469
1469
elif is_datetime64tz_dtype (dtype ):
1470
- dtype = DatetimeTZDtype (dtype )
1470
+ dtype = gt . DatetimeTZDtype (dtype )
1471
1471
else :
1472
1472
dtype = np .dtype (dtype )
1473
1473
return dtype
@@ -1478,15 +1478,15 @@ def _get_dtype(arr_or_dtype):
1478
1478
return arr_or_dtype
1479
1479
elif isinstance (arr_or_dtype , type ):
1480
1480
return np .dtype (arr_or_dtype )
1481
- elif isinstance (arr_or_dtype , CategoricalDtype ):
1481
+ elif isinstance (arr_or_dtype , gt . CategoricalDtype ):
1482
1482
return arr_or_dtype
1483
- elif isinstance (arr_or_dtype , DatetimeTZDtype ):
1483
+ elif isinstance (arr_or_dtype , gt . DatetimeTZDtype ):
1484
1484
return arr_or_dtype
1485
1485
elif isinstance (arr_or_dtype , compat .string_types ):
1486
1486
if is_categorical_dtype (arr_or_dtype ):
1487
- return CategoricalDtype .construct_from_string (arr_or_dtype )
1487
+ return gt . CategoricalDtype .construct_from_string (arr_or_dtype )
1488
1488
elif is_datetime64tz_dtype (arr_or_dtype ):
1489
- return DatetimeTZDtype .construct_from_string (arr_or_dtype )
1489
+ return gt . DatetimeTZDtype .construct_from_string (arr_or_dtype )
1490
1490
1491
1491
if hasattr (arr_or_dtype , 'dtype' ):
1492
1492
arr_or_dtype = arr_or_dtype .dtype
@@ -1498,15 +1498,15 @@ def _get_dtype_type(arr_or_dtype):
1498
1498
return arr_or_dtype .type
1499
1499
elif isinstance (arr_or_dtype , type ):
1500
1500
return np .dtype (arr_or_dtype ).type
1501
- elif isinstance (arr_or_dtype , CategoricalDtype ):
1502
- return CategoricalDtypeType
1503
- elif isinstance (arr_or_dtype , DatetimeTZDtype ):
1504
- return DatetimeTZDtypeType
1501
+ elif isinstance (arr_or_dtype , gt . CategoricalDtype ):
1502
+ return gt . CategoricalDtypeType
1503
+ elif isinstance (arr_or_dtype , gt . DatetimeTZDtype ):
1504
+ return gt . DatetimeTZDtypeType
1505
1505
elif isinstance (arr_or_dtype , compat .string_types ):
1506
1506
if is_categorical_dtype (arr_or_dtype ):
1507
- return CategoricalDtypeType
1507
+ return gt . CategoricalDtypeType
1508
1508
elif is_datetime64tz_dtype (arr_or_dtype ):
1509
- return DatetimeTZDtypeType
1509
+ return gt . DatetimeTZDtypeType
1510
1510
return _get_dtype_type (np .dtype (arr_or_dtype ))
1511
1511
try :
1512
1512
return arr_or_dtype .dtype .type
@@ -1558,7 +1558,7 @@ def is_datetime64_dtype(arr_or_dtype):
1558
1558
1559
1559
1560
1560
def is_datetime64tz_dtype (arr_or_dtype ):
1561
- return DatetimeTZDtype .is_dtype (arr_or_dtype )
1561
+ return gt . DatetimeTZDtype .is_dtype (arr_or_dtype )
1562
1562
1563
1563
1564
1564
def is_datetime64_any_dtype (arr_or_dtype ):
@@ -1719,7 +1719,7 @@ def is_categorical(array):
1719
1719
1720
1720
1721
1721
def is_categorical_dtype (arr_or_dtype ):
1722
- return CategoricalDtype .is_dtype (arr_or_dtype )
1722
+ return gt . CategoricalDtype .is_dtype (arr_or_dtype )
1723
1723
1724
1724
1725
1725
def is_complex_dtype (arr_or_dtype ):
0 commit comments