mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-16 10:25:58 +08:00
filter excel empty sheet (#8194)
This commit is contained in:
parent
86f7f245e4
commit
af92f19291
@ -38,7 +38,10 @@ class ExcelExtractor(BaseExtractor):
|
|||||||
for sheet_name in wb.sheetnames:
|
for sheet_name in wb.sheetnames:
|
||||||
sheet = wb[sheet_name]
|
sheet = wb[sheet_name]
|
||||||
data = sheet.values
|
data = sheet.values
|
||||||
cols = next(data)
|
try:
|
||||||
|
cols = next(data)
|
||||||
|
except StopIteration:
|
||||||
|
continue
|
||||||
df = pd.DataFrame(data, columns=cols)
|
df = pd.DataFrame(data, columns=cols)
|
||||||
|
|
||||||
df.dropna(how='all', inplace=True)
|
df.dropna(how='all', inplace=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user