From ab6515515d993ae335a960289d6af6ea518dd532 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 17 Aug 2023 10:15:21 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(types.py):=20add=20condition?= =?UTF-8?q?al=20check=20for=20task=5Fid=20and=20is=5Ftask=20to=20improve?= =?UTF-8?q?=20object=20representation=20in=20CustomComponentVertex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/graph/vertex/types.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/langflow/graph/vertex/types.py b/src/backend/langflow/graph/vertex/types.py index 597998515..672bd8ff9 100644 --- a/src/backend/langflow/graph/vertex/types.py +++ b/src/backend/langflow/graph/vertex/types.py @@ -255,5 +255,10 @@ class CustomComponentVertex(Vertex): super().__init__(data, base_type="custom_components", is_task=True) def _built_object_repr(self): + if self.task_id and self.is_task: + if task := self.get_task(): + return str(task.info) + else: + return f"Task {self.task_id} is not running" if self.artifacts and "repr" in self.artifacts: return self.artifacts["repr"] or super()._built_object_repr()