@@ -106,20 +106,22 @@ def _can_hold_na(self) -> bool:
106
106
else :
107
107
return False
108
108
109
+ _engine_types : dict [np .dtype : libindex .IndexEngine ] = {
110
+ np .dtype (np .int8 ): libindex .Int8Engine ,
111
+ np .dtype (np .int16 ): libindex .Int16Engine ,
112
+ np .dtype (np .int32 ): libindex .Int32Engine ,
113
+ np .dtype (np .int64 ): libindex .Int64Engine ,
114
+ np .dtype (np .uint8 ): libindex .UInt8Engine ,
115
+ np .dtype (np .uint16 ): libindex .UInt16Engine ,
116
+ np .dtype (np .uint32 ): libindex .UInt32Engine ,
117
+ np .dtype (np .uint64 ): libindex .UInt64Engine ,
118
+ np .dtype (np .float32 ): libindex .Float32Engine ,
119
+ np .dtype (np .float64 ): libindex .Float64Engine ,
120
+ }
121
+
109
122
@property
110
123
def _engine_type (self ):
111
- return {
112
- np .int8 : libindex .Int8Engine ,
113
- np .int16 : libindex .Int16Engine ,
114
- np .int32 : libindex .Int32Engine ,
115
- np .int64 : libindex .Int64Engine ,
116
- np .uint8 : libindex .UInt8Engine ,
117
- np .uint16 : libindex .UInt16Engine ,
118
- np .uint32 : libindex .UInt32Engine ,
119
- np .uint64 : libindex .UInt64Engine ,
120
- np .float32 : libindex .Float32Engine ,
121
- np .float64 : libindex .Float64Engine ,
122
- }[self .dtype .type ]
124
+ return self ._engine_types [self .dtype ]
123
125
124
126
@cache_readonly
125
127
def inferred_type (self ) -> str :
0 commit comments