diff --git a/docling/backend/msexcel_backend.py b/docling/backend/msexcel_backend.py index 508b0e8d..33146049 100644 --- a/docling/backend/msexcel_backend.py +++ b/docling/backend/msexcel_backend.py @@ -26,6 +26,7 @@ from typing import Any, List +from PIL import Image from pydantic import BaseModel @@ -326,10 +327,8 @@ def _find_images_in_sheet( self, doc: DoclingDocument, sheet: Worksheet ) -> DoclingDocument: - # FIXME: mypy does not agree with _images ... - """ # Iterate over images in the sheet - for idx, image in enumerate(sheet._images): # Access embedded images + for idx, image in enumerate(sheet._images): # type: ignore image_bytes = BytesIO(image.ref.blob) pil_image = Image.open(image_bytes) @@ -339,36 +338,32 @@ def _find_images_in_sheet( image=ImageRef.from_pil(image=pil_image, dpi=72), caption=None, ) - """ - # FIXME: mypy does not agree with _charts ... - """ - for idx, chart in enumerate(sheet._charts): # Access embedded charts + for idx, chart in enumerate(sheet._charts): # type: ignore chart_path = f"chart_{idx + 1}.png" _log.info( f"Chart found, but dynamic rendering is required for: {chart_path}" ) _log.info(f"Chart {idx + 1}:") - + # Chart type _log.info(f"Type: {type(chart).__name__}") - + # Title if chart.title: _log.info(f"Title: {chart.title}") else: _log.info("No title") - + # Data series for series in chart.series: _log.info(" => series ...") _log.info(f"Data Series: {series.title}") _log.info(f"Values: {series.values}") _log.info(f"Categories: {series.categories}") - + # Position # _log.info(f"Anchor Cell: {chart.anchor}") - """ return doc