Fix: chunk method error. (#11807)

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2025-12-08 14:28:23 +08:00
committed by GitHub
parent 43f51baa96
commit 09a3854ed8
2 changed files with 18 additions and 7 deletions

View File

@ -41,7 +41,7 @@ class RAGFlowExcelParser:
try:
file_like_object.seek(0)
df = pd.read_csv(file_like_object)
df = pd.read_csv(file_like_object, on_bad_lines='skip')
return RAGFlowExcelParser._dataframe_to_workbook(df)
except Exception as e_csv:
@ -164,7 +164,7 @@ class RAGFlowExcelParser:
except Exception as e:
logging.warning(f"Parse spreadsheet error: {e}, trying to interpret as CSV file")
file_like_object.seek(0)
df = pd.read_csv(file_like_object)
df = pd.read_csv(file_like_object, on_bad_lines='skip')
df = df.replace(r"^\s*$", "", regex=True)
return df.to_markdown(index=False)