I’m trying to use pymongo on a pyright/pylance using codebase (strict), but after a bunch of trying, I’ve decided to just add # type: ignore to a bunch of lines.
client: MongoClient[Dict[str, Any]] = MongoClient(settings.mongo_host) client.db.user.create_index([("user_id", ASCENDING)], unique=True)
Type of “create_index” is "(keys: str | Sequence[Tuple[str, int | str | Mapping[str, Any]]], session: ClientSession[Unknown] | None = None, comment: Any | None = None, **kwargs: Any) → str"PylancereportUnknownMemberType
And with bulk_write, even the let gets an unknown type on mapping.
Am I missing something obvious? If not, is there a plan to fix this?