From 792f8820881aa5bce18c1a45c086bc95232097ef Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 6 Feb 2025 18:16:22 -0300 Subject: [PATCH] fix: ensure file path is list before iterating over it (#6175) fix: Handle file path input for list-type fields in Vertex Co-authored-by: Cristhian Zanforlin Lousa --- src/backend/base/langflow/graph/vertex/base.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/backend/base/langflow/graph/vertex/base.py b/src/backend/base/langflow/graph/vertex/base.py index f048fac5d..bcc11f7c4 100644 --- a/src/backend/base/langflow/graph/vertex/base.py +++ b/src/backend/base/langflow/graph/vertex/base.py @@ -14,12 +14,7 @@ import pandas as pd from loguru import logger from langflow.exceptions.component import ComponentBuildError -from langflow.graph.schema import ( - INPUT_COMPONENTS, - OUTPUT_COMPONENTS, - InterfaceComponentTypes, - ResultData, -) +from langflow.graph.schema import INPUT_COMPONENTS, OUTPUT_COMPONENTS, InterfaceComponentTypes, ResultData from langflow.graph.utils import UnbuiltObject, UnbuiltResult, log_transaction from langflow.interface import initialize from langflow.interface.listing import lazy_load_dict @@ -363,6 +358,8 @@ class Vertex: full_path: str | list[str] = "" if field.get("list"): full_path = [] + if isinstance(file_path, str): + file_path = [file_path] for p in file_path: flow_id, file_name = os.path.split(p) path = storage_service.build_full_path(flow_id, file_name)