Skip to content

Commit 69b7d4c

Browse files
committed
Explicitly specify send type for AsyncGenerator
The docs suggest specifying a send type is optional, but recent FastAPI errors if it's not there. This fixes the error and does not change any code.
1 parent 8bdb9ad commit 69b7d4c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/labthings_fastapi/outputs/blob.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ def attach_to_app(self, app: FastAPI) -> None:
730730

731731
async def blob_serialisation_context_manager(
732732
request: Request,
733-
) -> AsyncGenerator[BlobDataManager]:
733+
) -> AsyncGenerator[BlobDataManager, None]:
734734
r"""Set context variables to allow blobs to be [de]serialised.
735735
736736
In order to serialise a `.Blob` to a JSON-serialisable dictionary, we must

src/labthings_fastapi/server/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def _attach_things_to_server(self) -> None:
241241
thing.attach_to_server(self)
242242

243243
@asynccontextmanager
244-
async def lifespan(self, app: FastAPI) -> AsyncGenerator[None]:
244+
async def lifespan(self, app: FastAPI) -> AsyncGenerator[None, None]:
245245
"""Manage set up and tear down of the server and Things.
246246
247247
This method is used as a lifespan function for the FastAPI app. See

0 commit comments

Comments
 (0)