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

Feature manager #37

Merged
merged 26 commits into from
Mar 27, 2023
Merged

Feature manager #37

merged 26 commits into from
Mar 27, 2023

Conversation

joshbrooks
Copy link
Contributor

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 🎉

@joshbrooks joshbrooks marked this pull request as draft March 20, 2023 05:01
@joshbrooks joshbrooks marked this pull request as ready for review March 22, 2023 03:40
Copy link
Member

@PeteCoward PeteCoward Mar 22, 2023

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?

Copy link
Contributor Author

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]

@joshbrooks
Copy link
Contributor Author

@joshbrooks joshbrooks merged commit 1e3405d into dev Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants