@@ -98,11 +98,11 @@ def delete_cost_with_datasource(self, domain_id: str, data_source_id: str) -> No
98
98
history_vos .delete ()
99
99
100
100
def get_cost (
101
- self ,
102
- cost_id : str ,
103
- domain_id : str ,
104
- workspace_id = None ,
105
- user_projects : list = None ,
101
+ self ,
102
+ cost_id : str ,
103
+ domain_id : str ,
104
+ workspace_id = None ,
105
+ user_projects : list = None ,
106
106
):
107
107
conditions = {"cost_id" : cost_id , "domain_id" : domain_id }
108
108
@@ -171,7 +171,7 @@ def analyze_yearly_costs(self, query, domain_id, target="SECONDARY_PREFERRED"):
171
171
expire = 3600 * 24 ,
172
172
)
173
173
def stat_monthly_costs_with_cache (
174
- self , query , query_hash , domain_id , data_source_id
174
+ self , query , query_hash , domain_id , data_source_id
175
175
):
176
176
return self .stat_monthly_costs (query , domain_id )
177
177
@@ -180,7 +180,7 @@ def stat_monthly_costs_with_cache(
180
180
expire = 3600 * 24 ,
181
181
)
182
182
def analyze_costs_with_cache (
183
- self , query , query_hash , domain_id , data_source_id , target = "SECONDARY_PREFERRED"
183
+ self , query , query_hash , domain_id , data_source_id , target = "SECONDARY_PREFERRED"
184
184
):
185
185
return self .analyze_costs (query , domain_id , target )
186
186
@@ -189,7 +189,7 @@ def analyze_costs_with_cache(
189
189
expire = 3600 * 24 ,
190
190
)
191
191
def analyze_monthly_costs_with_cache (
192
- self , query , query_hash , domain_id , data_source_id , target = "SECONDARY_PREFERRED"
192
+ self , query , query_hash , domain_id , data_source_id , target = "SECONDARY_PREFERRED"
193
193
):
194
194
return self .analyze_monthly_costs (query , domain_id , target )
195
195
@@ -198,12 +198,12 @@ def analyze_monthly_costs_with_cache(
198
198
expire = 3600 * 24 ,
199
199
)
200
200
def analyze_yearly_costs_with_cache (
201
- self , query , query_hash , domain_id , data_source_id , target = "SECONDARY_PREFERRED"
201
+ self , query , query_hash , domain_id , data_source_id , target = "SECONDARY_PREFERRED"
202
202
):
203
203
return self .analyze_yearly_costs (query , domain_id , target )
204
204
205
205
def analyze_costs_by_granularity (
206
- self , query : dict , domain_id : str , data_source_id : str
206
+ self , query : dict , domain_id : str , data_source_id : str
207
207
):
208
208
self ._check_group_by (query )
209
209
self ._check_date_range (query )
@@ -240,7 +240,7 @@ def analyze_costs_by_granularity(
240
240
expire = 600 ,
241
241
)
242
242
def create_cost_query_history (
243
- self , query : dict , query_hash : str , domain_id : str , data_source_id : str
243
+ self , query : dict , query_hash : str , domain_id : str , data_source_id : str
244
244
):
245
245
def _rollback (history_vo ):
246
246
_LOGGER .info (
@@ -444,7 +444,7 @@ def _change_filter_project_group_id(self, query: dict, domain_id: str) -> dict:
444
444
return query
445
445
446
446
def change_filter_v_workspace_id (
447
- self , query : dict , domain_id : str , data_source_id : str
447
+ self , query : dict , domain_id : str , data_source_id : str
448
448
) -> dict :
449
449
change_filter = []
450
450
workspace_ids = []
@@ -500,7 +500,7 @@ def change_filter_v_workspace_id(
500
500
return query
501
501
502
502
def _change_response_workspace_group_by (
503
- self , response : dict , query : dict , domain_id : str , data_source_id : str
503
+ self , response : dict , query : dict , domain_id : str , data_source_id : str
504
504
) -> dict :
505
505
if query_group_by := query .get ("group_by" ):
506
506
if "workspace_id" in query_group_by :
@@ -533,7 +533,7 @@ def _change_response_workspace_group_by(
533
533
return response
534
534
535
535
def _get_workspace_id_from_v_workspace_id (
536
- self , domain_id : str , v_workspace_id : str
536
+ self , domain_id : str , v_workspace_id : str
537
537
) -> str :
538
538
workspace_id = v_workspace_id
539
539
ds_account_vos = self .data_source_account_mgr .filter_data_source_accounts (
@@ -581,5 +581,5 @@ def _check_group_by(query: dict) -> None:
581
581
elif key in ["cost" , "usage_quantity" ]:
582
582
raise ERROR_INVALID_PARAMETER (
583
583
key = key ,
584
- reason = f"{ key } are not allowed to group by." ,
584
+ reason = f"{ key } is not allowed to group by." ,
585
585
)
0 commit comments