@@ -226,25 +226,25 @@ def _aggregate_monthly_cost_report_data(
226
226
aggregated_cost_report_data .get ("data_source_id" )
227
227
)
228
228
229
- aggregated_cost_report_data [
230
- "cost"
231
- ] = CostReportManager . get_exchange_currency (
232
- ag_cost , ag_cost_report_currency , self . currency_map
229
+ aggregated_cost_report_data ["cost" ] = (
230
+ CostReportManager . get_exchange_currency (
231
+ ag_cost , ag_cost_report_currency , self . currency_map
232
+ )
233
233
)
234
234
aggregated_cost_report_data ["currency" ] = currency
235
235
aggregated_cost_report_data ["issue_date" ] = issue_date
236
236
aggregated_cost_report_data ["report_month" ] = report_month
237
- aggregated_cost_report_data [
238
- "report_year"
239
- ] = aggregated_cost_report_data . pop ( "billed_year" )
237
+ aggregated_cost_report_data ["report_year" ] = (
238
+ aggregated_cost_report_data . pop ( "billed_year" )
239
+ )
240
240
aggregated_cost_report_data ["workspace_name" ] = workspace_name
241
241
aggregated_cost_report_data ["project_name" ] = project_name_map .get (
242
242
aggregated_cost_report_data ["project_id" ], "Unknown"
243
243
)
244
- aggregated_cost_report_data [
245
- "service_account_name"
246
- ] = service_account_name_map . get (
247
- aggregated_cost_report_data [ "service_account_id" ], "Unknown"
244
+ aggregated_cost_report_data ["service_account_name" ] = (
245
+ service_account_name_map . get (
246
+ aggregated_cost_report_data [ "service_account_id" ], "Unknown"
247
+ )
248
248
)
249
249
250
250
aggregated_cost_report_data ["cost_report_config_id" ] = cost_report_config_id
@@ -298,9 +298,9 @@ def _get_service_account_name_map(self, workspace_id: str, domain_id: str) -> di
298
298
domain_id ,
299
299
)
300
300
for service_account in service_accounts .get ("results" , []):
301
- service_account_name_map [
302
- service_account ["service_account_id " ]
303
- ] = service_account [ "name" ]
301
+ service_account_name_map [service_account [ "service_account_id" ]] = (
302
+ service_account ["name " ]
303
+ )
304
304
return service_account_name_map
305
305
306
306
@staticmethod
@@ -323,16 +323,17 @@ def _get_data_source_currency_map(
323
323
)
324
324
325
325
if data_source_state := data_source_filter .get ("state" , "ENABLED" ):
326
- query ["filter" ].append ({"k" : "state" , "v" : data_source_state , "o" : "eq" })
327
-
326
+ query ["filter" ].append (
327
+ {"k" : "schedule.state" , "v" : data_source_state , "o" : "eq" }
328
+ )
328
329
_LOGGER .debug (f"[get_data_source_currency_map] query: { query } " )
329
330
330
331
data_source_vos , total_count = data_source_mgr .list_data_sources (query )
331
332
data_source_ids = []
332
333
for data_source_vo in data_source_vos :
333
- data_source_currency_map [
334
- data_source_vo .data_source_id
335
- ] = data_source_vo . plugin_info [ "metadata" ][ "currency" ]
334
+ data_source_currency_map [data_source_vo . data_source_id ] = (
335
+ data_source_vo .plugin_info [ "metadata" ][ "currency" ]
336
+ )
336
337
data_source_ids .append (data_source_vo .data_source_id )
337
338
338
339
return data_source_currency_map , data_source_ids
0 commit comments