File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
cads_processing_api_service Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -181,15 +181,20 @@ def compute_costing(
181
181
if request_origin not in COST_THRESHOLDS :
182
182
raise ValueError (f"Invalid request origin: { request_origin } " )
183
183
cost_threshold = COST_THRESHOLDS [request_origin ]
184
- costs : dict [str , float ] = adaptor .estimate_costs (
184
+ costs : dict [str , Any ] = adaptor .estimate_costs (
185
185
request = request , cost_threshold = cost_threshold
186
186
)
187
+ costs_numeric = {
188
+ cost_id : cost
189
+ for cost_id , cost in costs .items ()
190
+ if isinstance (cost , (int , float ))
191
+ }
187
192
costing_config : dict [str , Any ] = adaptor_properties ["config" ].get ("costing" , {})
188
193
limits : dict [str , Any ] = costing_config .get ("max_costs" , {})
189
194
cost_bar_steps = (
190
195
costing_config .get ("cost_bar_steps" , None ) if request_origin == "ui" else None
191
196
)
192
197
costing_info = models .CostingInfo (
193
- costs = costs , limits = limits , cost_bar_steps = cost_bar_steps
198
+ costs = costs_numeric , limits = limits , cost_bar_steps = cost_bar_steps
194
199
)
195
200
return costing_info
You can’t perform that action at this time.
0 commit comments