Skip to content

Upgrading fastapi 0.105 to 0.106

Breaking0.105.0 → 0.106.0Breaking1New1Changed1

BreakingUpgrade verdict

1 breaking change.

  • If a background task relied on objects created by a dependency that uses yield, such as a database connection, that no longer works. Background tasks must create their own resources.
1 item needs code or config changes
Breaking1
Removes support for using resources from dependencies with yield inside background tasks.
yield

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • removed: method FastAPI.build_middleware_stack() -> ASGIApp
  • changed: async function solve_dependencies(*, request: Union[Request, WebSocket], dependant: Dependant, body: Optional[Union[Dict[str, Any], FormData]]=…, background_tasks: Optional[StarletteBackgroundTasks]=…, response: Optional[Response]=…, dependency_overrides_provider: Optional[Any]=…, dependency_cache: Optional[Dict[Tuple[Callable[..., Any], Tuple[str]], Any]]=…) -> Tuple[Dict[str, Any], List[Any], O… → async function solve_dependencies(*, request: Union[Request, WebSocket], dependant: Dependant, body: Optional[Union[Dict[str, Any], FormData]]=…, background_tasks: Optional[StarletteBackgroundTasks]=…, response: Optional[Response]=…, dependency_overrides_provider: Optional[Any]=…, dependency_cache: Optional[Dict[Tuple[Callable[..., Any], Tuple[str]], Any]]=…, async_exit_stack: AsyncExitStack) ->…
  • removed: class AsyncExitStackMiddleware
  • removed: constructor AsyncExitStackMiddleware(app: ASGIApp, context_name: str=…) -> None