Skip to content

Missing stubs in mongoengine connection #71

Description

@edward-petersen-cynn

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions