-
Notifications
You must be signed in to change notification settings - Fork 106
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
add validation to filters in legal/search endpoint #6088
base: develop
Are you sure you want to change the base?
add validation to filters in legal/search endpoint #6088
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6088 +/- ##
===========================================
+ Coverage 88.46% 88.47% +0.01%
===========================================
Files 82 82
Lines 9091 9110 +19
===========================================
+ Hits 8042 8060 +18
- Misses 1049 1050 +1 ☔ View full report in Codecov by Sentry. |
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.
Great job dealing with a tricky issue, and thank you for cleaning up the code!
- My understanding was FE wants all of the filters to have the same behavior—should we confirm and open a follow-up ticket for the other filters? What about type, ao_is_pending, ao_citation_require_all, case_citation_require_all—can they be updated in this PR since they also have the option in swagger —?
- If someone includes an empty string and a string it throws a 500—should we update the check_filter_exists function to not throw a 500? IE http://localhost:5000/v1/legal/search/?type=advisory_opinions&ao_requestor_type=1&ao_requestor_type=
I agree with @cnlucas. |
|
|
da4fc87
to
2b3abbd
Compare
Summary (required)
Resolves Make empty string behavior consistent on the legal search endpoint #6024
Modify
ao_requestor_type
filter from int to stringAdd field validation for mur_type filter
Update tests
Update docs.py
Required reviewers
2 developers
Impacted areas of the application
How to test
on local:
git checkout feature/6024-legal-search-validate-dropdown-filters
pyenv activate
run elasticsearch service
run
pytest
run
python cli.py create_index ao_index
run
python cli.py create_index arch_mur_index
run
python cli.py create_index case_index
run
python cli.py load_advisory_opinions 2024-01
(15 AO's loaded to local ES service)run
python cli.py load_archived_murs
run
python cli.py load_current_murs
run
flask run
test filters
http://localhost:5000/v1/legal/search/?type=advisory_opinions (all 15 show)
http://localhost:5000/v1/legal/search/?type=advisory_opinions&ao_requestor_type=1&ao_requestor_type=6 (8 results show)
http://localhost:5000/v1/legal/search/?type=advisory_opinions&ao_requestor_type=16&ao_requestor_type=3 (3 results show)
http://localhost:5000/v1/legal/search/?type=murs&mur_type=current
http://localhost:5000/v1/legal/search/?type=murs&mur_type=archived
http://localhost:5000/v1/legal/search/?type="" (should throw validation error)
On Dev: Deploy a feature/test branch and test the filters against Dev api
-test filters: