Beanie is missing complete type annotations on some objects, such as Document, which cause Mypy to fail when used.
To Reproduce
The following code:
from beanie import Document
d = Document()
Throws a type check error when run with Mypy:
$ mypy main.py
main.py:3: error: Call to untyped function "Document" in typed context [no-untyped-call]
Found 1 error in 1 file (checked 1 source file)
Describe the bug
Beanie is missing complete type annotations on some objects, such as
Document
, which cause Mypy to fail when used.To Reproduce
The following code:
Throws a type check error when run with Mypy:
With the following Mypy configuration:
This config can be further simplified to
This seems to be because this line, the constructor is not fully typed, it is missing
-> None
:https://github.com/roman-right/beanie/blob/5f03c6f6312fd0232505cc9bebf8ac1b22ca95ac/beanie/odm/documents.py#L189
Expected behavior
No Mypy type check errors when using Beanie, even with in
strict
mode.Additional context
Reproduced on:
Somewhat related to
672
769