From 293adb0417f4b5dbd3572de98135a161b43fcd04 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 27 Jun 2024 15:20:42 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20(custom=5Fcomponent.py):=20fix?= =?UTF-8?q?=20issue=20where=20name=20was=20not=20being=20set=20correctly?= =?UTF-8?q?=20when=20name=20is=20None=20and=20self.display=5Fname=20is=20T?= =?UTF-8?q?rue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../langflow/custom/custom_component/custom_component.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/base/langflow/custom/custom_component/custom_component.py b/src/backend/base/langflow/custom/custom_component/custom_component.py index 779618e9a..ee8192496 100644 --- a/src/backend/base/langflow/custom/custom_component/custom_component.py +++ b/src/backend/base/langflow/custom/custom_component/custom_component.py @@ -488,11 +488,14 @@ class CustomComponent(BaseComponent): Args: message (LoggableType | list[LoggableType]): The message to log. """ - if name is None: + if name is None and self.display_name: name = self.display_name + else: + name = self.__class__.__name__ log = Log(message=message, type=get_artifact_type(message), name=name) self._logs.append(log) - self.tracing_service.add_log(trace_name=self.vertex.id, log=log) + if self.tracing_service and self.vertex: + self.tracing_service.add_log(trace_name=self.vertex.id, log=log) def post_code_processing(self, new_build_config: dict, current_build_config: dict): """