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

'"Union" is unknown import symbol' - from django.contrib.gis.db.models #536

Closed
wkrueger opened this issue Oct 28, 2020 · 2 comments
Closed
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs

Comments

@wkrueger
Copy link

wkrueger commented Oct 28, 2020

Environment data

  • Language Server version: 2020.9.114305
  • OS and version: Windows
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8,5 running on docker container (remote extension)

requirements.txt

appdirs==1.4.4
asgiref==3.2.10
astroid==2.4.2
black==20.8b1
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
coreapi==2.3.3
coreschema==0.0.4
Django==3.1.1
django-cors-headers==3.5.0
django-filter==2.4.0
djangorestframework==3.11.1
djangorestframework-gis==0.16
djangorestframework-simplejwt==4.4.0
drf-yasg==1.17.1
GDAL==2.4.0
idna==2.10
inflection==0.5.1
isort==5.5.3
itypes==1.2.0
Jinja2==2.11.2
lazy-object-proxy==1.4.3
MarkupSafe==1.1.1
mccabe==0.6.1
mypy-extensions==0.4.3
packaging==20.4
pathspec==0.8.0
psycopg2==2.8.6
PyJWT==1.7.1
pylint==2.6.0
pyparsing==2.4.7
pytz==2020.1
regex==2020.7.14
requests==2.24.0
ruamel.yaml==0.16.12
ruamel.yaml.clib==0.2.2
six==1.15.0
sqlparse==0.3.1
toml==0.10.1
typed-ast==1.4.1
typing-extensions==3.7.4.3
uritemplate==3.0.1
urllib3==1.25.10
wrapt==1.12.1

Expected behaviour

In:

from django.contrib.gis.db.models import Union, GeometryField

Both imported variables Unionand GeometryFields should be recognized. and get completions.

Actual behaviour

While GeometryFields is recognized, Union is treated as if didnt exist.

PS: It exists and is normally used in the code.

Logs

Background analysis message: setFileOpened
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
[FG] parsing: /var/www/storage/storage_app/app/geostore/geostore_service.py (5ms)
[FG] binding: /var/www/storage/storage_app/app/geostore/geostore_service.py (1ms)
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
Background analysis message: analyze
[BG(1)] analyzing: /var/www/storage/storage_app/app/geostore/geostore_service.py ...
[BG(1)]   parsing: /var/www/storage/storage_app/app/geostore/geostore_service.py (15ms)
[BG(1)]   binding: /var/www/storage/storage_app/app/geostore/geostore_service.py (1ms)
[BG(1)]   checking: /var/www/storage/storage_app/app/geostore/geostore_service.py (12ms)
[BG(1)] analyzing: /var/www/storage/storage_app/app/geostore/geostore_service.py (28ms)
Background analysis message: resumeAnalysis
Background analysis message: getDiagnosticsForRange
Background analysis message: getDiagnosticsForRange
@jakebailey
Copy link
Member

jakebailey commented Oct 28, 2020

This has been fixed in the upstream source for the Django stubs, so it just needs a pull on our end to grab them.

@jakebailey jakebailey added the typestub Issue relating to our bundled type stubs label Oct 28, 2020
@github-actions github-actions bot removed the triage label Oct 28, 2020
@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Oct 28, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.10.3, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#2020103-28-october-2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs
Projects
None yet
Development

No branches or pull requests

2 participants