From e59966bff8a7c6aceee7bd99c46d1c14e4a30ece Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sat, 22 Jun 2024 00:38:01 -0300 Subject: [PATCH] refactor: Update set_run_id method to accept only uuid.UUID or None as run_id parameter --- src/backend/base/langflow/graph/graph/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/base/langflow/graph/graph/base.py b/src/backend/base/langflow/graph/graph/base.py index b8fa6936b..2cd5af1fa 100644 --- a/src/backend/base/langflow/graph/graph/base.py +++ b/src/backend/base/langflow/graph/graph/base.py @@ -213,7 +213,7 @@ class Graph: raise ValueError("Run ID not set") return self._run_id - def set_run_id(self, run_id: str | uuid.UUID | None = None): + def set_run_id(self, run_id: uuid.UUID | None = None): """ Sets the ID of the current run. @@ -223,10 +223,10 @@ class Graph: if run_id is None: run_id = uuid.uuid4() - run_id = str(run_id) + run_id_str = str(run_id) for vertex in self.vertices: - self.state_manager.subscribe(run_id, vertex.update_graph_state) - self._run_id = run_id + self.state_manager.subscribe(run_id_str, vertex.update_graph_state) + self._run_id = run_id_str if self.tracing_service: self.tracing_service.set_run_id(run_id)