-
-
Notifications
You must be signed in to change notification settings - Fork 484
AssertionError: Type info for django.db.models.query._QuerySet missing #1323
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
Comments
This looks a lot like code I've written 😇 Do you have any additional pointers to how this happens? I've never seen this bug before, but it seems a bit strange to me. Basically the error means that mypy has not loaded the Django models when checking a model file, which seems strange. I assumed that would always be the case. I can throw together a potential fix that you can try |
Can reproduce with a traceback at the exact same line. Running CLI mypy (no VSCode) in a pipenv.
|
Do you have an example of a file that triggers this? I'm not able to reproduce this, so I'm not really able to fix it until I can understand how/why it fails |
Aha. The problem is caused by having both It persists even after uninstalling I realize |
Ah, thanks! I can try to see if I can make it handle that case or at the very least point to this issue when it pops up |
@ljodal hello mate, sorry for not getting back to you earlier as I didnt see the notification. I dont actually have django-types. What can I provide to help debug this? I am still running without the VScode mypy extension currently to avoid the error. |
Have you re-checked if you are using the right python virtual environment? I faced this and another issue when I moved to a new laptop with Ventura, and did not select the right virtual env with my project dependencies installed, but the system python interpreter. |
VScode mypy Django QuerySet error
Hi, I am not using anything out of the ordinary other than mypy and django-stubs. When my VScode runs mypy it crashes with this traceback below.
mypy almost always seems to crash with VScode open. I had originally patched files here
But it was a very crude way of getting it to work.
It does on occasion work for a few minutes (or at least not error) but I cannot seem to replicate its success on command.
I have been through several open and closed issues closely related but can't find anything similar to what I am facing.
I also don't know if this bug will be covered by this release. - #1316
Would be grateful for any help on this as its stopping my VScode from running mypy on my code and get a popup appear everytime I do a code change.
System information
python
version: 3.11.0django
version: 4.1.4mypy
version: 0.991django-stubs
version: 1.13.0django-stubs-ext
version: 0.7.0vscode
version: 1.74.3The text was updated successfully, but these errors were encountered: