From 0cfcfcb912283994e69920649dede806eadc0419 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 3 Jul 2023 16:38:06 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(types.py):=20remove=20extra?= =?UTF-8?q?=20blank=20line=20to=20improve=20code=20readability=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(GenericNode/index.tsx):=20remove=20unused=20?= =?UTF-8?q?imports=20and=20unused=20variable=20to=20improve=20code=20clean?= =?UTF-8?q?liness=20The=20extra=20blank=20line=20in=20the=20`types.py`=20f?= =?UTF-8?q?ile=20has=20been=20removed=20to=20improve=20the=20readability?= =?UTF-8?q?=20of=20the=20code.=20In=20the=20`GenericNode/index.tsx`=20file?= =?UTF-8?q?,=20unused=20imports=20and=20an=20unused=20variable=20have=20be?= =?UTF-8?q?en=20removed=20to=20clean=20up=20the=20code=20and=20improve=20m?= =?UTF-8?q?aintainability.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/graph/vertex/types.py | 1 + .../src/CustomNodes/GenericNode/index.tsx | 16 +++------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/backend/langflow/graph/vertex/types.py b/src/backend/langflow/graph/vertex/types.py index af2081217..29690821d 100644 --- a/src/backend/langflow/graph/vertex/types.py +++ b/src/backend/langflow/graph/vertex/types.py @@ -91,6 +91,7 @@ class DocumentLoaderVertex(Vertex): def _built_object_repr(self): # This built_object is a list of documents. Maybe we should # show how many documents are in the list? + if self._built_object: return f"""{self.vertex_type}({len(self._built_object)} documents) Documents: {self._built_object[:3]}...""" diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index cd49aaa5b..56f1283c1 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -6,16 +6,7 @@ import { } from "../../utils"; import ParameterComponent from "./components/parameterComponent"; import { typesContext } from "../../contexts/typesContext"; -import { - useContext, - useState, - useEffect, - useRef, - ForwardRefExoticComponent, - ComponentType, - SVGProps, - ReactNode, -} from "react"; +import { useContext, useState, useEffect, useRef } from "react"; import { NodeDataType } from "../../types/flow"; import { alertContext } from "../../contexts/alertContext"; import { PopUpContext } from "../../contexts/popUpContext"; @@ -26,7 +17,6 @@ import NodeToolbarComponent from "../../pages/FlowPage/components/nodeToolbarCom import ShadTooltip from "../../components/ShadTooltipComponent"; import { useSSE } from "../../contexts/SSEContext"; -import { ReactElement } from "react-markdown/lib/react-markdown"; export default function GenericNode({ data, @@ -241,8 +231,8 @@ export default function GenericNode({