From 70d9742d16f8710e10f744f807fe1d8efa25bd51 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 14 Sep 2023 14:09:06 -0300 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20fix(parameterComponent):=20f?= =?UTF-8?q?ix=20type=20comparison=20for=20"NestedDict"=20to=20improve=20ac?= =?UTF-8?q?curacy=20and=20consistency=20=F0=9F=90=9B=20fix(EditNodeModal):?= =?UTF-8?q?=20fix=20type=20comparison=20for=20"NestedDict"=20to=20improve?= =?UTF-8?q?=20accuracy=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GenericNode/components/parameterComponent/index.tsx | 2 +- src/frontend/src/modals/EditNodeModal/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 50f14f7b4..998186f83 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -244,7 +244,7 @@ export default function ParameterComponent({ type === "int") && !optionalHandle ? ( <> - ) : left === true && type === "nested_dict" ? ( + ) : left === true && type === "NestedDict" ? (
) : myData.node?.template[templateParam] - .type === "nested_dict" ? ( + .type === "NestedDict" ? (
Date: Thu, 14 Sep 2023 14:09:18 -0300 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8=20feat(field=5Ftyping):=20add=20N?= =?UTF-8?q?estedDict=20type=20alias=20to=20improve=20code=20readability=20?= =?UTF-8?q?and=20maintainability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/field_typing/__init__.py | 3 +++ src/backend/langflow/field_typing/base.py | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 src/backend/langflow/field_typing/__init__.py create mode 100644 src/backend/langflow/field_typing/base.py diff --git a/src/backend/langflow/field_typing/__init__.py b/src/backend/langflow/field_typing/__init__.py new file mode 100644 index 000000000..927716b11 --- /dev/null +++ b/src/backend/langflow/field_typing/__init__.py @@ -0,0 +1,3 @@ +from .base import NestedDict + +__all__ = ["NestedDict"] diff --git a/src/backend/langflow/field_typing/base.py b/src/backend/langflow/field_typing/base.py new file mode 100644 index 000000000..ed3219888 --- /dev/null +++ b/src/backend/langflow/field_typing/base.py @@ -0,0 +1,4 @@ +from typing import Union, Dict + +# Type alias for more complex dicts +NestedDict = Dict[str, Union[str, Dict]]