chore: apply flake8-comprehensions Ruff rules to improve collection comprehensions (#5652)

Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
Bowen Liang
2024-06-27 11:21:31 +08:00
committed by GitHub
parent 2e718b85e9
commit dcb72e0067
58 changed files with 123 additions and 136 deletions

View File

@@ -417,7 +417,7 @@ class ProviderManager:
model_load_balancing_enabled = cache_result == 'True'
if not model_load_balancing_enabled:
return dict()
return {}
provider_load_balancing_configs = db.session.query(LoadBalancingModelConfig) \
.filter(
@@ -451,7 +451,7 @@ class ProviderManager:
if not provider_records:
provider_records = []
provider_quota_to_provider_record_dict = dict()
provider_quota_to_provider_record_dict = {}
for provider_record in provider_records:
if provider_record.provider_type != ProviderType.SYSTEM.value:
continue
@@ -661,7 +661,7 @@ class ProviderManager:
provider_hosting_configuration = hosting_configuration.provider_map.get(provider_entity.provider)
# Convert provider_records to dict
quota_type_to_provider_records_dict = dict()
quota_type_to_provider_records_dict = {}
for provider_record in provider_records:
if provider_record.provider_type != ProviderType.SYSTEM.value:
continue