diff --git a/api/core/workflow/workflow_type_encoder.py b/api/core/workflow/workflow_type_encoder.py index 6eac2dd6b4..6b2657b4dc 100644 --- a/api/core/workflow/workflow_type_encoder.py +++ b/api/core/workflow/workflow_type_encoder.py @@ -11,7 +11,9 @@ from core.variables import Segment class WorkflowRuntimeTypeConverter: def to_json_encodable(self, value: Mapping[str, Any] | None) -> Mapping[str, Any] | None: result = self._to_json_encodable_recursive(value) - return result if isinstance(result, Mapping) or result is None else dict(result) + if isinstance(result, Mapping) or result is None: + return result + return {} def _to_json_encodable_recursive(self, value: Any): if value is None: diff --git a/api/pyrightconfig.json b/api/pyrightconfig.json index 7c59c2ca28..61ed3ac3b4 100644 --- a/api/pyrightconfig.json +++ b/api/pyrightconfig.json @@ -12,7 +12,7 @@ "core/ops", "core/tools", "core/model_runtime", - "core/workflow", + "core/workflow/nodes", "core/app/app_config/easy_ui_based_app/dataset" ], "typeCheckingMode": "strict",