From e6f75eb9cd50ac278f111fecee27d65490f91046 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sat, 27 Dec 2025 21:26:25 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Auto=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/dependencies/utils.py | 4 +++- fastapi/routing.py | 2 +- fastapi/types.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py index cee9a5ffa..2d84fd3bb 100644 --- a/fastapi/dependencies/utils.py +++ b/fastapi/dependencies/utils.py @@ -599,7 +599,9 @@ async def solve_dependencies( and dependency_overrides_provider.dependency_overrides ): original_call = sub_dependant.call - call = dependency_overrides_provider.dependency_overrides.get(original_call, original_call) + call = dependency_overrides_provider.dependency_overrides.get( + original_call, original_call + ) use_path: str = sub_dependant.path # type: ignore use_sub_dependant = get_dependant( path=use_path, diff --git a/fastapi/routing.py b/fastapi/routing.py index d70e804cc..c39f95154 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -48,7 +48,7 @@ from fastapi.exceptions import ( ResponseValidationError, WebSocketRequestValidationError, ) -from fastapi.types import DecoratedCallable, IncEx, DependencyOverridesProvider +from fastapi.types import DecoratedCallable, DependencyOverridesProvider, IncEx from fastapi.utils import ( create_cloned_field, create_model_field, diff --git a/fastapi/types.py b/fastapi/types.py index 62667c782..465861616 100644 --- a/fastapi/types.py +++ b/fastapi/types.py @@ -1,6 +1,6 @@ import types from enum import Enum -from typing import Any, Callable, Optional, TypeVar, Union, Protocol +from typing import Any, Callable, Optional, Protocol, TypeVar, Union from pydantic import BaseModel @@ -10,5 +10,6 @@ ModelNameMap = dict[Union[type[BaseModel], type[Enum]], str] IncEx = Union[set[int], set[str], dict[int, Any], dict[str, Any]] DependencyCacheKey = tuple[Optional[Callable[..., Any]], tuple[str, ...], str] + class DependencyOverridesProvider(Protocol): dependency_overrides: dict[Callable[..., Any], Any]