@@ -50,9 +50,6 @@ def normalize_substrait_type_names(typ: str) -> str:
50
50
return typ
51
51
52
52
53
- id_generator = itertools .count (1 )
54
-
55
-
56
53
def to_integer_option (txt : str ):
57
54
if txt .isnumeric ():
58
55
return ParameterizedType .IntegerOption (literal = int (txt ))
@@ -153,7 +150,7 @@ def to_parameterized_type(dtype: str):
153
150
user_defined = ParameterizedType .ParameterizedUserDefined ()
154
151
)
155
152
else :
156
- raise Exception (f"Unkownn type - { dtype } " )
153
+ raise Exception (f"Unknown type - { dtype } " )
157
154
158
155
159
156
def violates_integer_option (
@@ -210,11 +207,11 @@ def covers(dtype: Type, parameterized_type: ParameterizedType, parameters: dict)
210
207
211
208
212
209
class FunctionEntry :
213
- def __init__ (self , uri : str , name : str , impl : Mapping [str , Any ]) -> None :
210
+ def __init__ (self , uri : str , name : str , impl : Mapping [str , Any ], anchor : int ) -> None :
214
211
self .name = name
215
212
self .normalized_inputs : list = []
216
213
self .uri : str = uri
217
- self .anchor = next ( id_generator )
214
+ self .anchor = anchor
218
215
self .arguments = []
219
216
self .rtn = impl ["return" ]
220
217
self .nullability = impl .get ("nullability" , False )
@@ -286,7 +283,7 @@ def register_extension_dict(self, definitions: dict, uri: str) -> None:
286
283
for named_functions in definitions .values ():
287
284
for function in named_functions :
288
285
for impl in function .get ("impls" , []):
289
- func = FunctionEntry (uri , function ["name" ], impl )
286
+ func = FunctionEntry (uri , function ["name" ], impl , next ( self . id_generator ) )
290
287
if (
291
288
func .uri in self ._function_mapping
292
289
and function ["name" ] in self ._function_mapping [func .uri ]
0 commit comments