瀏覽代碼

fix openpyxl dimensions error (#1041)

WangBooth 1 年之前
父節點
當前提交
ad5f27bc5f
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      api/core/data_loader/loader/excel.py

+ 2 - 0
api/core/data_loader/loader/excel.py

@@ -30,6 +30,8 @@ class ExcelLoader(BaseLoader):
         wb = load_workbook(filename=self._file_path, read_only=True)
         # loop over all sheets
         for sheet in wb:
+            if 'A1:A1' == sheet.calculate_dimension():
+                sheet.reset_dimensions()
             for row in sheet.iter_rows(values_only=True):
                 if all(v is None for v in row):
                     continue