Skip to content

Commit

Permalink
fix: remove type parameters to AgnosticClient
Browse files Browse the repository at this point in the history
  • Loading branch information
samderanova committed Dec 13, 2023
1 parent 3b1dbde commit 58cea47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/api/src/services/mongodb_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 58cea47

Please sign in to comment.