Bugfix/swi 63 handle empty policy area
SWI: Ignore empty policy area
TYPE: Bugfix LINK: swi-63
Checklist
- [x] I have performed a self-review of my code
- [x] I considered adding a reviewer
- [x] I have tested my code thoroughly by hand
- [x] I have added tests for my changes/features
Is there a way to influence the converters to handle this case?
Codecov Report
:x: Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 86.41%. Comparing base (444995f) to head (ddc3461).
:warning: Report is 164 commits behind head on master.
:white_check_mark: All tests successful. No failed tests found.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/onegov/core/filters.py | 81.81% | 2 Missing :warning: |
Additional details and impacted files
| Files with missing lines | Coverage Δ | |
|---|---|---|
| src/onegov/swissvotes/collections/votes.py | 98.92% <100.00%> (+<0.01%) |
:arrow_up: |
| src/onegov/swissvotes/converters.py | 100.00% <100.00%> (ø) |
|
| src/onegov/swissvotes/path.py | 97.82% <100.00%> (+0.04%) |
:arrow_up: |
| src/onegov/core/filters.py | 86.95% <81.81%> (-3.96%) |
:arrow_down: |
... and 2 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 444995f...ddc3461. Read the comment docs.
:rocket: New features to boost your workflow:
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Is there a way to influence the converters to handle this case?
Yes, you can write a custom converter for the policy area format, so any values that don't conform to the format get dropped.
Ideally we change the collection to accept list[PolicyArea] instead and write a converter for PolicyArea that verifies the format, split the string over . and make sure each component is numeric and starts with the previous component.