@@ -207,7 +207,7 @@ def __init__(self, provider, report_type, schema_name, cost_type, markup_cost="m
207
207
Coalesce (F (self .markup_cost ), Value (0 , output_field = DecimalField ()))
208
208
* Coalesce ("exchange_rate" , Value (1 , output_field = DecimalField ()))
209
209
),
210
- "usage" : Sum (F ("usage_amount" )),
210
+ "usage" : Sum (Coalesce ( F ("usage_amount" ), Value ( 0 , output_field = DecimalField ()) )),
211
211
"usage_units" : Coalesce (Max ("unit" ), Value ("GB-Mo" )),
212
212
},
213
213
"annotations" : {
@@ -249,7 +249,7 @@ def __init__(self, provider, report_type, schema_name, cost_type, markup_cost="m
249
249
),
250
250
# the `currency_annotation` is inserted by the `annotations` property of the query-handler
251
251
"cost_units" : Coalesce ("currency_annotation" , Value ("USD" , output_field = CharField ())),
252
- "usage" : Sum ("usage_amount" ),
252
+ "usage" : Sum (Coalesce ( F ( "usage_amount" ), Value ( 0 , output_field = DecimalField ())) ),
253
253
"usage_units" : Coalesce (Max ("unit" ), Value ("GB-Mo" )),
254
254
"clusters" : ArrayAgg (Coalesce ("cluster_alias" , "cluster_id" ), distinct = True ),
255
255
"source_uuid" : ArrayAgg (
@@ -303,7 +303,7 @@ def __init__(self, provider, report_type, schema_name, cost_type, markup_cost="m
303
303
Coalesce (F (self .markup_cost ), Value (0 , output_field = DecimalField ()))
304
304
* Coalesce ("exchange_rate" , Value (1 , output_field = DecimalField ()))
305
305
),
306
- "usage" : Sum (F ("usage_amount" )),
306
+ "usage" : Sum (Coalesce ( F ("usage_amount" ), Value ( 0 , output_field = DecimalField ()) )),
307
307
"usage_units" : Coalesce (Max ("unit" ), Value ("GB-Mo" )),
308
308
},
309
309
"aggregate_key" : "usage_amount" ,
@@ -346,7 +346,7 @@ def __init__(self, provider, report_type, schema_name, cost_type, markup_cost="m
346
346
),
347
347
# the `currency_annotation` is inserted by the `annotations` property of the query-handler
348
348
"cost_units" : Coalesce ("currency_annotation" , Value ("USD" , output_field = CharField ())),
349
- "usage" : Sum ("usage_amount" ),
349
+ "usage" : Sum (Coalesce ( F ( "usage_amount" ), Value ( 0 , output_field = DecimalField ())) ),
350
350
"usage_units" : Coalesce (Max ("unit" ), Value ("Hrs" )),
351
351
"clusters" : ArrayAgg (Coalesce ("cluster_alias" , "cluster_id" ), distinct = True ),
352
352
"source_uuid" : ArrayAgg (
0 commit comments