You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Beanie is missing complete type annotations on some objects, such as Document, which cause Mypy to fail when used.
To Reproduce
The following code:
frombeanieimportDocumentd=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)
johnthagen
changed the title
[BUG] Document type fails type check for instantiation with Mypy in strict mode
[BUG] Document constructor fails type check for instantiation with Mypy in strict mode
Dec 21, 2023
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
The text was updated successfully, but these errors were encountered: