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 <cristhian.lousa@gmail.com>
This commit is contained in:
Gabriel Luiz Freitas Almeida 2025-02-06 18:16:22 -03:00 committed by GitHub
commit 792f882088
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)