chore: Remove deprecated type aliases and run as pre-commit (#79)

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
Michele Dolfi
2025-03-07 15:46:52 +01:00
committed by GitHub
parent c95db36438
commit 7e75919ae8
10 changed files with 38 additions and 34 deletions

View File

@@ -5,7 +5,7 @@ import tempfile
from contextlib import asynccontextmanager
from io import BytesIO
from pathlib import Path
from typing import Annotated, Any, Dict, List, Optional, Union
from typing import Annotated, Any, Optional, Union
from fastapi import (
BackgroundTasks,
@@ -205,8 +205,8 @@ def create_app(): # noqa: C901
def process_url(
background_tasks: BackgroundTasks, conversion_request: ConvertDocumentsRequest
):
sources: List[Union[str, DocumentStream]] = []
headers: Optional[Dict[str, Any]] = None
sources: list[Union[str, DocumentStream]] = []
headers: Optional[dict[str, Any]] = None
if isinstance(conversion_request, ConvertDocumentFileSourcesRequest):
for file_source in conversion_request.file_sources:
sources.append(file_source.to_document_stream())
@@ -242,7 +242,7 @@ def create_app(): # noqa: C901
)
async def process_file(
background_tasks: BackgroundTasks,
files: List[UploadFile],
files: list[UploadFile],
options: Annotated[
ConvertDocumentsOptions, FormDepends(ConvertDocumentsOptions)
],