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
commit dcb72e0067
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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