From 58cea47155281cd22fd12446b945d09b091db9a2 Mon Sep 17 00:00:00 2001 From: Sam Der Date: Wed, 13 Dec 2023 12:01:33 -0800 Subject: [PATCH] fix: remove type parameters to AgnosticClient --- apps/api/src/services/mongodb_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/api/src/services/mongodb_handler.py b/apps/api/src/services/mongodb_handler.py index f86d1180..a5cb67f1 100644 --- a/apps/api/src/services/mongodb_handler.py +++ b/apps/api/src/services/mongodb_handler.py @@ -14,7 +14,10 @@ STAGING_ENV = os.getenv("DEPLOYMENT") == "STAGING" MONGODB_URI = os.getenv("MONGODB_URI") -MONGODB_CLIENT: AgnosticClient[Mapping[str, object]] = AsyncIOMotorClient(MONGODB_URI) + +# Mypy thinks AgnosticClient is a generic type, but providing type parameters to it +# raises a TypeError. +MONGODB_CLIENT: AgnosticClient = AsyncIOMotorClient(MONGODB_URI) # type: ignore # Resolve Vercel runtime issue MONGODB_CLIENT.get_io_loop = asyncio.get_event_loop # type: ignore