From 57d6a78d4ee6aa1292a72b91b04fbeb0b6aa07b6 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 5 Mar 2024 21:47:02 -0300 Subject: [PATCH] Refactor utils.py: Fix formatting and import statements --- src/backend/langflow/interface/custom/utils.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/backend/langflow/interface/custom/utils.py b/src/backend/langflow/interface/custom/utils.py index c7e33b992..49e686b5e 100644 --- a/src/backend/langflow/interface/custom/utils.py +++ b/src/backend/langflow/interface/custom/utils.py @@ -15,12 +15,15 @@ from langflow.interface.custom.attributes import ATTR_FUNC_MAPPING from langflow.interface.custom.code_parser.utils import extract_inner_type from langflow.interface.custom.custom_component import CustomComponent from langflow.interface.custom.directory_reader.utils import ( - build_custom_component_list_from_path, determine_component_name, - merge_nested_dicts_with_renaming) + build_custom_component_list_from_path, + determine_component_name, + merge_nested_dicts_with_renaming, +) from langflow.interface.custom.eval import eval_custom_component_code from langflow.template.field.base import TemplateField -from langflow.template.frontend_node.custom_components import \ - CustomComponentFrontendNode +from langflow.template.frontend_node.custom_components import ( + CustomComponentFrontendNode, +) from langflow.utils import validate from langflow.utils.util import get_base_classes @@ -221,7 +224,7 @@ def add_extra_fields(frontend_node, field_config, function_args): key in function_args_names for key in field_config.keys() ): for field_name, field_config in _field_config.copy().items(): - if "name" not in extra_field: + if "name" not in field_config or field_name == "code": continue config = _field_config.get(field_name, {}) config = config.model_dump() if isinstance(config, BaseModel) else config