mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-02 07:22:14 +00:00
fix(msexcel): ignore Mypy checking for _find_images_in_sheet function
Signed-off-by: Jiun An Tsai <andrew@247365-Macbook.local>
This commit is contained in:
parent
2b591f9872
commit
8ec3f176eb
@ -26,6 +26,7 @@ _log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
from typing import Any, List
|
from typing import Any, List
|
||||||
|
|
||||||
|
from PIL import Image
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
|
||||||
@ -326,10 +327,8 @@ class MsExcelDocumentBackend(DeclarativeDocumentBackend):
|
|||||||
self, doc: DoclingDocument, sheet: Worksheet
|
self, doc: DoclingDocument, sheet: Worksheet
|
||||||
) -> DoclingDocument:
|
) -> DoclingDocument:
|
||||||
|
|
||||||
# FIXME: mypy does not agree with _images ...
|
|
||||||
"""
|
|
||||||
# Iterate over images in the sheet
|
# 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)
|
image_bytes = BytesIO(image.ref.blob)
|
||||||
pil_image = Image.open(image_bytes)
|
pil_image = Image.open(image_bytes)
|
||||||
@ -339,11 +338,8 @@ class MsExcelDocumentBackend(DeclarativeDocumentBackend):
|
|||||||
image=ImageRef.from_pil(image=pil_image, dpi=72),
|
image=ImageRef.from_pil(image=pil_image, dpi=72),
|
||||||
caption=None,
|
caption=None,
|
||||||
)
|
)
|
||||||
"""
|
|
||||||
|
|
||||||
# FIXME: mypy does not agree with _charts ...
|
for idx, chart in enumerate(sheet._charts): # type: ignore
|
||||||
"""
|
|
||||||
for idx, chart in enumerate(sheet._charts): # Access embedded charts
|
|
||||||
chart_path = f"chart_{idx + 1}.png"
|
chart_path = f"chart_{idx + 1}.png"
|
||||||
_log.info(
|
_log.info(
|
||||||
f"Chart found, but dynamic rendering is required for: {chart_path}"
|
f"Chart found, but dynamic rendering is required for: {chart_path}"
|
||||||
@ -369,6 +365,5 @@ class MsExcelDocumentBackend(DeclarativeDocumentBackend):
|
|||||||
|
|
||||||
# Position
|
# Position
|
||||||
# _log.info(f"Anchor Cell: {chart.anchor}")
|
# _log.info(f"Anchor Cell: {chart.anchor}")
|
||||||
"""
|
|
||||||
|
|
||||||
return doc
|
return doc
|
||||||
|
Loading…
Reference in New Issue
Block a user