mongo-types icon indicating copy to clipboard operation
mongo-types copied to clipboard

Missing stubs in mongoengine connection

Open edward-petersen-cynn opened this issue 2 years ago • 0 comments

Steps to reproduce:

  1. Create a module that includes the following code:
import mongoengine

mongoengine.register_connection(
    alias="core",
    name="foobar",
    username="username",
    password="password",
)

connection = mongoengine.get_connection("core")
  1. Run mypy against it:
python -m mypy ./mongo-types-mypy_issue.py
  1. Observe that mypy does not trigger on register_connection, but does trigger on get_connection:
[snip ...]/mongo-types-mypy_issue.py:10: error: Module has no attribute "get_connection"  [attr-defined]
Found 1 error in 1 file (checked 1 source file)

Expected Behavior: Since __all__ exported by the connection.py module includes get_connection that there would be a stub for it.

edward-petersen-cynn avatar Aug 28 '23 18:08 edward-petersen-cynn