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