@@ -181,6 +181,7 @@ def get_parsed_specs(key: str):
181
181
return parsed
182
182
183
183
def parse_target_value_map_from_spec (spec , parsed ):
184
+ unsupported_specs = set ()
184
185
for rule in spec .get ("rules" , []):
185
186
for i , cond in enumerate (rule .get ("conditions" , [])):
186
187
op = cond .get ("operator" , None )
@@ -190,12 +191,12 @@ def parse_target_value_map_from_spec(spec, parsed):
190
191
op = op .lower ()
191
192
if op not in Const .SUPPORTED_OPERATORS :
192
193
self .unsupported_configs .add (spec .get ("name" ))
193
- del parsed [ spec .get ("name" )]
194
+ unsupported_specs . add ( spec .get ("name" ))
194
195
if cond_type is not None :
195
196
cond_type = cond_type .lower ()
196
197
if cond_type not in Const .SUPPORTED_CONDITION_TYPES :
197
198
self .unsupported_configs .add (spec .get ("name" ))
198
- del parsed [ spec .get ("name" )]
199
+ unsupported_specs . add ( spec .get ("name" ))
199
200
200
201
if op in ("any" , "none" ) and cond_type == "user_bucket" :
201
202
rule ["conditions" ][i ]["user_bucket" ] = {}
@@ -220,6 +221,9 @@ def parse_target_value_map_from_spec(spec, parsed):
220
221
rule ["conditions" ][i ]["fast_target_value" ] = {}
221
222
for val in target_value :
222
223
rule ["conditions" ][i ]["fast_target_value" ][str (val )] = True
224
+ for spec_name in unsupported_specs :
225
+ if spec_name in parsed :
226
+ del parsed [spec_name ]
223
227
224
228
self .unsupported_configs .clear ()
225
229
new_gates = get_parsed_specs (EntityType .GATE .value )
0 commit comments