Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing stubs in mongoengine connection #71

Open
edward-petersen-cynn opened this issue Aug 28, 2023 · 0 comments
Open

Missing stubs in mongoengine connection #71

edward-petersen-cynn opened this issue Aug 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@edward-petersen-cynn
Copy link

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.

@sbdchd sbdchd added the bug Something isn't working label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants