소스 검색

Fix: remove redundant allowed_keys check in jsonable_encoder (#23931)

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
Co-authored-by: Yongtao Huang <99629139+hyongtao-db@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
tags/1.8.0
Yongtao Huang 2 달 전
부모
커밋
f40e2cf98a
No account linked to committer's email address
3개의 변경된 파일3개의 추가작업 그리고 6개의 파일을 삭제
  1. 2
    5
      api/core/model_runtime/utils/encoders.py
  2. 1
    1
      api/core/provider_manager.py
  3. 0
    0
      api/core/workflow/workflow_engine_manager.py

+ 2
- 5
api/core/model_runtime/utils/encoders.py 파일 보기

@@ -151,12 +151,9 @@ def jsonable_encoder(
return format(obj, "f")
if isinstance(obj, dict):
encoded_dict = {}
allowed_keys = set(obj.keys())
for key, value in obj.items():
if (
(not sqlalchemy_safe or (not isinstance(key, str)) or (not key.startswith("_sa")))
and (value is not None or not exclude_none)
and key in allowed_keys
if (not sqlalchemy_safe or (not isinstance(key, str)) or (not key.startswith("_sa"))) and (
value is not None or not exclude_none
):
encoded_key = jsonable_encoder(
key,

+ 1
- 1
api/core/provider_manager.py 파일 보기

@@ -523,7 +523,7 @@ class ProviderManager:
# Init trial provider records if not exists
if ProviderQuotaType.TRIAL not in provider_quota_to_provider_record_dict:
try:
# FIXME ignore the type errork, onyl TrialHostingQuota has limit need to change the logic
# FIXME ignore the type error, only TrialHostingQuota has limit need to change the logic
new_provider_record = Provider(
tenant_id=tenant_id,
# TODO: Use provider name with prefix after the data migration.

+ 0
- 0
api/core/workflow/workflow_engine_manager.py 파일 보기


Loading…
취소
저장