Browse Source

example of next(, None) (#24345)

tags/1.8.0
Asuka Minato 2 months ago
parent
commit
51cc2bf429
No account linked to committer's email address
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      api/core/rag/extractor/excel_extractor.py

+ 2
- 3
api/core/rag/extractor/excel_extractor.py View File

@@ -34,9 +34,8 @@ class ExcelExtractor(BaseExtractor):
for sheet_name in wb.sheetnames:
sheet = wb[sheet_name]
data = sheet.values
try:
cols = next(data)
except StopIteration:
cols = next(data, None)
if cols is None:
continue
df = pd.DataFrame(data, columns=cols)


Loading…
Cancel
Save