Преглед изворни кода

excel: get keys from every sheet (#2796)

tags/0.5.10
Weaxs пре 1 година
родитељ
комит
20bd49285b
No account linked to committer's email address
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1
    1
      api/core/rag/extractor/excel_extractor.py

+ 1
- 1
api/core/rag/extractor/excel_extractor.py Прегледај датотеку

def extract(self) -> list[Document]: def extract(self) -> list[Document]:
"""Load from file path.""" """Load from file path."""
data = [] data = []
keys = []
wb = load_workbook(filename=self._file_path, read_only=True) wb = load_workbook(filename=self._file_path, read_only=True)
# loop over all sheets # loop over all sheets
for sheet in wb: for sheet in wb:
keys = []
if 'A1:A1' == sheet.calculate_dimension(): if 'A1:A1' == sheet.calculate_dimension():
sheet.reset_dimensions() sheet.reset_dimensions()
for row in sheet.iter_rows(values_only=True): for row in sheet.iter_rows(values_only=True):

Loading…
Откажи
Сачувај