-
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
Fix sched-a by-employer,by-occupation and schedule_b/by_recipient fulltext and n/a search issue #5809
Conversation
ce6eddd
to
f5cd046
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5809 +/- ##
===========================================
- Coverage 85.81% 85.77% -0.05%
===========================================
Files 81 81
Lines 8594 8624 +30
===========================================
+ Hits 7375 7397 +22
- Misses 1219 1227 +8 ☔ 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.
@fec-jli Thanks for addressing the longstanding text search bug. Nice work.
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.
@fec-jli great job on this ticket!
Could we either add testing for the new filter or create a follow-up ticket to add an automated test for the new filter?
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 work!
A follow-up ticket to add an automated test for the new filter will be created by @fec-jli
Summary
This PR will fix fulltext search and N/A search issue in these three endpoints
ScheduleAByEmployerView
ScheduleAByOccupationView
ScheduleBByRecipientView
Resolves determine if dsc_sched_a_aggregate_employer aggregates as intended #3885
Related Add tsvector column to schedule A and schedule B aggregate data #5790
Create follow up openFEC ticket to fix N/A issue on schedule-a and schedule-b endpoints
cms ticket: N/A for schedule A datatable not filtering correctly from canonical page fec-cms#5220
Required reviewers
1-2 devs
Impacted three endpoints
"/schedules/schedule_a/by_employer/"
"/schedules/schedule_a/by_occupation/"
"/schedules/schedule_b/by_recipient/"
How to test
—[1]ScheduleAByEmployerView
Test 1-1) when employer=amazon.com, return two rows:
employer=amazon.com
employer=amazon com
http://127.0.0.1:5000/v1/schedules/schedule_a/by_employer/?cycle=2020&employer=amazon.com&committee_id=C00003418
When employer=-amazon.com (exclude amazon.com), return 127487 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_employer/?cycle=2020&employer=-amazon.com&committee_id=C00003418
Without employer parameter pass, return 2+ 127487= 127489 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_employer/?cycle=2020&committee_id=C00003418
Compare with Prod: return 1 (only employer=amazon com, no return for employer=amazon.com)
https://api.open.fec.gov/v1/schedules/schedule_a/by_employer/?cycle=2020&committee_id=C00003418&api_key=DEMO_KEY&employer=amazon.com
Test 1-2)
when employer=N/A, return 1 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_employer/?cycle=2020&employer=N/A&committee_id=C00003418
when employer=-N/A, return 127488 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_employer/?cycle=2020&employer=-N/A&committee_id=C00003418
Without employer parameter pass, return 1+ 127488= 127489 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_employer/?cycle=2020&committee_id=C00003418
Compare with Prod: return 962 rows (contain: n, a…)
https://api.open.fec.gov/v1/schedules/schedule_a/by_employer/?cycle=2020&committee_id=C00003418&api_key=DEMO_KEY&employer=N/A
—[2]ScheduleAByOccupationView
Test 2-1)
when occupation=C.E.O, return 46 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_occupation/?cycle=2022&committee_id=C00003418&occupation=C.E.O
when occupation=-C.E.O, return 19665 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_occupation/?cycle=2022&committee_id=C00003418&occupation=-C.E.O
Without occupation parameter pass, return 46+ 19665 =19711 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_occupation/?cycle=2022&committee_id=C00003418
Compare with Prod: return 29 (occupation=c…e…o)
https://api.open.fec.gov/v1/schedules/schedule_a/by_occupation/?cycle=2022&committee_id=C00003418&occupation=C.E.O&api_key=DEMO_KEY
Test 2-2)
when occupation=N/A, return 1 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_occupation/?cycle=2020&committee_id=C00003418&occupation=N/A
when occupation=-N/A, return 39455 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_occupation/?cycle=2020&committee_id=C00003418&occupation=-N/A
Without occupation parameter pass, return 1+ 39455 = 39456 rows
http://127.0.0.1:5000/v1/schedules/schedule_a/by_occupation/?cycle=2020&committee_id=C00003418
Compare with Prod: return 193 rows (contain: n, a…)
https://api.open.fec.gov/v1/schedules/schedule_a/by_occupation/?cycle=2020&committee_id=C00003418&occupation=N/A&api_key=DEMO_KEY
—[3]ScheduleBByRecipientView
Test 3-1)
When recipient_name=zoom.com, return 1 row
http://127.0.0.1:5000/v1/schedules/schedule_b/by_recipient/?cycle=2022&committee_id=C00160937&recipient_name=zoom.com
When recipient_name=-zoom.com, return 126 rows
http://127.0.0.1:5000/v1/schedules/schedule_b/by_recipient/?cycle=2022&committee_id=C00160937&recipient_name=-zoom.com
Without recipient_name parameter pass, return 1+126=127 rows
http://127.0.0.1:5000/v1/schedules/schedule_b/by_recipient/?cycle=2022&committee_id=C00160937
Compare prod, return 0 (cannot find recipient_name=zoom.com)
https://api.open.fec.gov/v1/schedules/schedule_b/by_recipient/?cycle=2022&committee_id=C00160937&recipient_name=zoom.com&api_key=DEMO_KEY
Test 3-2)
when recipient_name=N/A, return 1 rows
http://127.0.0.1:5000/v1/schedules/schedule_b/by_recipient/?cycle=2018&committee_id=C00586768&recipient_name=N/A
when recipient_name=-N/A, return 17 rows
http://127.0.0.1:5000/v1/schedules/schedule_b/by_recipient/?cycle=2018&committee_id=C00586768&recipient_name=-N/A
Without recipient_name parameter pass, return 1+17=18 rows
http://127.0.0.1:5000/v1/schedules/schedule_b/by_recipient/?cycle=2018&committee_id=C00586768
Compare prod, return 0 (cannot find recipient_name=N/A)
https://api.open.fec.gov/v1/schedules/schedule_b/by_recipient/?cycle=2018&committee_id=C00586768&recipient_name=N/A&api_key=DEMO_KEY
Replace PR: #5773