mirror of
https://github.com/DS4SD/docling.git
synced 2025-12-11 22:28:31 +00:00
fix: xlsx cell parsing, now returning values instead of formulas (#2520)
* fix: xlsx doc parsing, now returning values instead of formulas Signed-off-by: glypt <8trash-can8@protonmail.ch> * fix: add test for better coverage of xlsx backend Signed-off-by: glypt <8trash-can8@protonmail.ch> * fix: add the total of ducks as a formula in the tests/data This also adds the test that the value 310 is contained in the table. Without the fix from the previous commit, it would return "B7+C7" Signed-off-by: glypt <8trash-can8@protonmail.ch> --------- Signed-off-by: glypt <8trash-can8@protonmail.ch>
This commit is contained in:
@@ -139,10 +139,14 @@ class MsExcelDocumentBackend(DeclarativeDocumentBackend, PaginatedDocumentBacken
|
||||
self.workbook = None
|
||||
try:
|
||||
if isinstance(self.path_or_stream, BytesIO):
|
||||
self.workbook = load_workbook(filename=self.path_or_stream)
|
||||
self.workbook = load_workbook(
|
||||
filename=self.path_or_stream, data_only=True
|
||||
)
|
||||
|
||||
elif isinstance(self.path_or_stream, Path):
|
||||
self.workbook = load_workbook(filename=str(self.path_or_stream))
|
||||
self.workbook = load_workbook(
|
||||
filename=str(self.path_or_stream), data_only=True
|
||||
)
|
||||
|
||||
self.valid = self.workbook is not None
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user