Describe the bug
mypy does not raise error when trying to access a non-existing attribute from a beanie Document. It works fine with a pydantic model.
To Reproduce
from pydantic import BaseModel
from beanie import Document
class TestPydantic(BaseModel):
foo: str
class TestBeanie(Document):
foo: str
test_pydantic = TestPydantic(foo="test")
test_beanie = TestBeanie(foo="test")
print(test_pydantic.bar) # This is detected as an error by mypy
print(test_beanie.bar) # This is not
Expected behavior
missing attributes in Documents should be detected by mypy the same way as with pydantic's BaseModels
Describe the bug mypy does not raise error when trying to access a non-existing attribute from a beanie Document. It works fine with a pydantic model.
To Reproduce
Expected behavior missing attributes in Documents should be detected by mypy the same way as with pydantic's BaseModels
Additional context