fix: text access in file component (#7798)
Fix text access in file component
This commit is contained in:
parent
c5c1d33478
commit
5f96d18fb1
1 changed files with 3 additions and 3 deletions
|
|
@ -264,8 +264,8 @@ class BaseFileComponent(Component, ABC):
|
|||
else:
|
||||
# Handle non-CSV files as before
|
||||
row = dict(data.data) if data.data else {}
|
||||
if data.text:
|
||||
row["text"] = data.text
|
||||
if "text" in data.data:
|
||||
row["text"] = data.data["text"]
|
||||
if file_path:
|
||||
row["file_path"] = file_path
|
||||
non_csv_rows.append(row)
|
||||
|
|
@ -287,7 +287,7 @@ class BaseFileComponent(Component, ABC):
|
|||
# Concatenate all text content
|
||||
text_content = []
|
||||
for data in data_list:
|
||||
content = data.text if data.text else ""
|
||||
content = data.get_text()
|
||||
text_content.append(content)
|
||||
|
||||
# Join with separator
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue