Skip to content

Commit

Permalink
format remove Optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Cycloctane committed Feb 14, 2025
1 parent d211607 commit f6e1cd0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kreuzberg/_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from io import BytesIO
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import TYPE_CHECKING, Optional
from typing import TYPE_CHECKING

import html_to_markdown
import pptx
Expand Down Expand Up @@ -38,7 +38,7 @@ async def convert_pdf_to_images(file_path: Path) -> list[Image]:
Returns:
A list of Pillow Images.
"""
pdf: Optional[pypdfium2.PdfDocument] = None
pdf: pypdfium2.PdfDocument | None = None
resolved_path = str(await AsyncPath(file_path).resolve())
try:
pdf = await run_sync(pypdfium2.PdfDocument, resolved_path)
Expand Down Expand Up @@ -78,7 +78,7 @@ async def extract_pdf_with_pdfium2(file_path: Path) -> str:
Returns:
The extracted text.
"""
document: Optional[pypdfium2.PdfDocument] = None
document: pypdfium2.PdfDocument | None = None
resolved_path = str(await AsyncPath(file_path).resolve())
try:
document = await run_sync(pypdfium2.PdfDocument, resolved_path)
Expand Down

0 comments on commit f6e1cd0

Please sign in to comment.