diff --git a/fastagency/db/prisma.py b/fastagency/db/prisma.py index da473d6a4..d4d447ba2 100644 --- a/fastagency/db/prisma.py +++ b/fastagency/db/prisma.py @@ -4,13 +4,13 @@ from typing import TYPE_CHECKING, Any, AsyncGenerator, Dict, List, Optional, Union from uuid import UUID +from faststream import ContextRepo from prisma import Prisma # type: ignore[attr-defined] from .base import BackendDBProtocol, DefaultDB, FrontendDBProtocol, KeyNotFoundError if TYPE_CHECKING: from fastapi import FastAPI - from faststream import ContextRepo class PrismaBaseDB: @@ -212,6 +212,6 @@ async def fastapi_lifespan(app: "FastAPI") -> AsyncGenerator[None, None]: @asynccontextmanager -async def faststream_lifespan(context: "ContextRepo") -> AsyncGenerator[None, None]: +async def faststream_lifespan(context: ContextRepo) -> AsyncGenerator[None, None]: async with _lifespan(): yield diff --git a/fastagency/io/app.py b/fastagency/io/app.py index 6a2687949..add9a9758 100644 --- a/fastagency/io/app.py +++ b/fastagency/io/app.py @@ -1,10 +1,7 @@ from os import environ from typing import Optional -from faststream import ( - ContextRepo, # noqa - FastStream, -) +from faststream import FastStream from faststream.nats import JStream, NatsBroker from ..db.prisma import faststream_lifespan