@@ -36,8 +36,8 @@ def construct_array_type(cls) -> type[IntegerArray]:
3636 return IntegerArray
3737
3838 @classmethod
39- def _str_to_dtype_mapping (cls ):
40- return INT_STR_TO_DTYPE
39+ def _get_dtype_mapping (cls ) -> dict [ np . dtype , IntegerDtype ] :
40+ return NUMPY_INT_TO_DTYPE
4141
4242 @classmethod
4343 def _safe_cast (cls , values : np .ndarray , dtype : np .dtype , copy : bool ) -> np .ndarray :
@@ -208,13 +208,13 @@ class UInt64Dtype(IntegerDtype):
208208 __doc__ = _dtype_docstring .format (dtype = "uint64" )
209209
210210
211- INT_STR_TO_DTYPE : dict [str , IntegerDtype ] = {
212- " int8" : Int8Dtype (),
213- " int16" : Int16Dtype (),
214- " int32" : Int32Dtype (),
215- " int64" : Int64Dtype (),
216- " uint8" : UInt8Dtype (),
217- " uint16" : UInt16Dtype (),
218- " uint32" : UInt32Dtype (),
219- " uint64" : UInt64Dtype (),
211+ NUMPY_INT_TO_DTYPE : dict [np . dtype , IntegerDtype ] = {
212+ np . dtype ( np . int8 ) : Int8Dtype (),
213+ np . dtype ( np . int16 ) : Int16Dtype (),
214+ np . dtype ( np . int32 ) : Int32Dtype (),
215+ np . dtype ( np . int64 ) : Int64Dtype (),
216+ np . dtype ( np . uint8 ) : UInt8Dtype (),
217+ np . dtype ( np . uint16 ) : UInt16Dtype (),
218+ np . dtype ( np . uint32 ) : UInt32Dtype (),
219+ np . dtype ( np . uint64 ) : UInt64Dtype (),
220220}
0 commit comments