From bb847db2b80f58a48ba3735595be14b02e451b51 Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Thu, 13 Jun 2024 00:04:24 -0300 Subject: [PATCH] refactor: Fix bug in Vertex class when checking if param is a list Update the Vertex class in base.py to fix a bug in the logic for checking if a parameter is a list. The current implementation only checks if the "list" key exists in the template_dict, but it should also check if the value of the "list" key is truthy. This change ensures that the correct condition is used to determine if a parameter is a list, preventing potential overwriting of params with the same name but different target_id. --- src/backend/base/langflow/graph/vertex/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/base/langflow/graph/vertex/base.py b/src/backend/base/langflow/graph/vertex/base.py index bff37199e..4bdcece3c 100644 --- a/src/backend/base/langflow/graph/vertex/base.py +++ b/src/backend/base/langflow/graph/vertex/base.py @@ -302,7 +302,7 @@ class Vertex: # We check this to make sure params with the same name but different target_id # don't get overwritten if param_key in template_dict and edge.target_id == self.id: - if template_dict[param_key]["list"]: + if template_dict[param_key].get("list"): if param_key not in params: params[param_key] = [] params[param_key].append(self.graph.get_vertex(edge.source_id))