-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature manager #37
Feature manager #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for this pyi file given the py file has these types already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still necessary for mypy
to pass on the Area
model - this is probably because Area
is not a regular Django model but an MPTTModel and I am guessing that the magic smoke and mirrors of MPTT prevents MyPy from being able to pick the types, as you can see if I delete the pyi we get test failures:
(simple-locations-8QRkAbfK-py3.8) josh@carbonite:~/github/catalpainternational/simple_locations$ rm simple_locations/models.pyi
(simple-locations-8QRkAbfK-py3.8) josh@carbonite:~/github/catalpainternational/simple_locations$ poetry run mypy .
simple_locations/models.py:66: error: Item "None" of "Optional[Field[Any, Any]]" has no attribute "db_column" [union-attr]
simple_locations/models.py:66: error: Item "None" of "Optional[Field[Any, Any]]" has no attribute "attname" [union-attr]
simple_locations/models.py:122: error: Need type annotation for "name" [var-annotated]
simple_locations/models.py:123: error: Need type annotation for "code" [var-annotated]
simple_locations/models.py:124: error: Need type annotation for "kind" [var-annotated]
simple_locations/models.py:125: error: Need type annotation for "location" [var-annotated]
simple_locations/models.py:127: error: Need type annotation for "parent" [var-annotated]
simple_locations/management/commands/import_dird.py:238: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
tests/test_feature_manager.py:21: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
tests/test_feature_manager.py:28: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
tests/test_feature_manager.py:33: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
tests/test_feature_manager.py:39: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
This is now in DIRD@main: https://github.com/catalpainternational/openly_dird/pull/1890 |
Django 3.2 introduced some really nice JSON functions
I'm working on this branch to make our geoJSON endpoints faster + more transparent for Openly DIRD and Partisipa's upcoming suco information 🎉