fix: address code review — use modern type hints and Callable annotation
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
+2
-2
@@ -1450,7 +1450,7 @@ def claim_file(request: Request, file_id: int, db: DbSession):
|
||||
|
||||
@router.post("/files/bulk-claim")
|
||||
@require_login
|
||||
def bulk_claim_files(request: Request, file_ids: List[int], db: DbSession):
|
||||
def bulk_claim_files(request: Request, file_ids: list[int], db: DbSession):
|
||||
"""
|
||||
Claim multiple unowned documents for the current user.
|
||||
|
||||
@@ -1496,7 +1496,7 @@ def bulk_claim_files(request: Request, file_ids: List[int], db: DbSession):
|
||||
|
||||
@router.post("/files/assign-owner")
|
||||
@require_login
|
||||
def assign_owner(request: Request, db: DbSession, owner_id: str = Query(...), file_ids: List[int] | None = None):
|
||||
def assign_owner(request: Request, db: DbSession, owner_id: str = Query(...), file_ids: list[int] | None = None):
|
||||
"""
|
||||
Admin-only: assign an owner to documents.
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ the bundled static list.
|
||||
|
||||
import logging
|
||||
import subprocess # noqa: S404 — only used with fixed args, no user input
|
||||
from typing import Callable
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -407,7 +408,7 @@ def get_embedding_models() -> list[str]:
|
||||
# Registry — maps setting keys to their provider functions
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
SUGGESTION_PROVIDERS: dict[str, callable] = {
|
||||
SUGGESTION_PROVIDERS: dict[str, Callable[[], list[str]]] = {
|
||||
"aws_region": get_aws_regions,
|
||||
"azure_region": get_azure_regions,
|
||||
"tesseract_language": get_tesseract_languages,
|
||||
|
||||
Reference in New Issue
Block a user