-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: 3.3, 3.3.1
-
Component/s: None
-
None
The following list triggered issues with `mypy` in our codebase. Upon closer inspection of the runtime code these appeared to be wrongly typed:
- AgnosticBaseCursor.to_list accepts only an int but should take int | None or Optional[int]
- AgnosticCollection.name is typed as a function but implemented as a property
- AgnosticDatabase.get_collection is typed as an async method but implemented as a sync method
- AgnosticClientSession.with_transaction read_preference parameter is typed as Optional[_ServerMode] but takes Optional[pymongo.ReadPreference] type
- AgnosticCollection needs to inherit from Generic[_DocumentType] in order to properly type AgnosticCollection.find_one and similar methods