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

[blocked by frontend]Add candidate_id limitation on schedule a aggregate #5779

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

fec-jli
Copy link
Contributor

@fec-jli fec-jli commented Mar 31, 2024

Summary (required)

This PR will add filter by "candidate_id" limitation (max =10) on three endpoints:
ScheduleABySizeCandidateView
ScheduleAByStateCandidateView
ScheduleAByStateCandidateTotalsView

Required reviewers

1-2 devs

Impacted areas of the application

ScheduleABySizeCandidateView
ScheduleAByStateCandidateView
ScheduleAByStateCandidateTotalsView

How to test

  • checkout branch
  • pytest
  • test urls

1)/schedules/schedule_a/by_size/by_candidate/:
pass 10 candidate_ids:
http://127.0.0.1:5000/v1/schedules/schedule_a/by_size/by_candidate/?sort=size&candidate_id=P80001571&candidate_id=S2TX00106&candidate_id=H6IL09061&candidate_id=H8IA01094&candidate_id=H8MO03164&candidate_id=P80003338&candidate_id=H6MT01095&candidate_id=H4CA12055&candidate_id=S6CT00042&candidate_id=S2ND00099&cycle=2020&election_full=true&per_page=200

pass 11 candidate_ids:
http://127.0.0.1:5000/v1/schedules/schedule_a/by_size/by_candidate/?sort=size&candidate_id=P80001571&candidate_id=S2TX00106&candidate_id=H6IL09061&candidate_id=H8IA01094&candidate_id=H8MO03164&candidate_id=P80003338&candidate_id=H6MT01095&candidate_id=H4CA12055&candidate_id=S6CT00042&candidate_id=S2ND00099&candidate_id=P80003353&cycle=2020&election_full=true&per_page=200

2)/schedules/schedule_a/by_state/by_candidate/
pass 10 candidate_ids:
http://127.0.0.1:5000/v1/schedules/schedule_a/by_state/by_candidate/?sort=state&candidate_id=P80001571&candidate_id=S2TX00106&candidate_id=H6IL09061&candidate_id=H8IA01094&candidate_id=H8MO03164&candidate_id=P80003338&candidate_id=H6MT01095&candidate_id=H4CA12055&candidate_id=S6CT00042&candidate_id=S2ND00099&cycle=2020&election_full=true&per_page=200

pass 11 candidate_ids:
http://127.0.0.1:5000/v1/schedules/schedule_a/by_state/by_candidate/?sort=state&candidate_id=P80001571&candidate_id=S2TX00106&candidate_id=H6IL09061&candidate_id=H8IA01094&candidate_id=H8MO03164&candidate_id=P80003338&candidate_id=H6MT01095&candidate_id=H4CA12055&candidate_id=S6CT00042&candidate_id=S2ND00099&candidate_id=P80003353&cycle=2020&election_full=true&per_page=200

3)/schedules/schedule_a/by_state/by_candidate/totals
pass 10 candidate_ids:
http://127.0.0.1:5000/v1/schedules/schedule_a/by_state/by_candidate/totals/?sort=total&candidate_id=P80001571&candidate_id=S2TX00106&candidate_id=H6IL09061&candidate_id=H8IA01094&candidate_id=H8MO03164&candidate_id=P80003338&candidate_id=H6MT01095&candidate_id=H4CA12055&candidate_id=S6CT00042&candidate_id=S2ND00099&cycle=2020&election_full=true&per_page=200

pass 11 candidate_ids:
http://127.0.0.1:5000/v1/schedules/schedule_a/by_state/by_candidate/totals/?sort=total&candidate_id=P80001571&candidate_id=S2TX00106&candidate_id=H6IL09061&candidate_id=H8IA01094&candidate_id=H8MO03164&candidate_id=P80003338&candidate_id=H6MT01095&candidate_id=H4CA12055&candidate_id=S6CT00042&candidate_id=S2ND00099&candidate_id=P80003353&cycle=2020&election_full=true&per_page=200

@fec-jli fec-jli changed the title Add candidate_id limition on schedule a aggreate Add candidate_id limitation on schedule a aggregate Mar 31, 2024
Copy link
Member

@cnlucas cnlucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working well for me, but I think we should consider two things. First, should this get a dep notice to anyone using these endpoints because it would break their code if they are using 10+ candidates? Have you checked API umbrella?
Also, I think that we should make some design/CMS changes to https://www.fec.gov/data/elections/president/2024/ Individual contributions to candidates tables
because it will no longer work for more than 10 candidates, but that's not super clear when using it.
Overall, great job, let me know your thoughts on the above.

Copy link
Contributor

@tmpayton tmpayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @fec-jli! Tested the candidate_id cap and it works well!

@fec-jli fec-jli changed the title Add candidate_id limitation on schedule a aggregate [block by frontend]Add candidate_id limitation on schedule a aggregate Apr 3, 2024
@fec-jli fec-jli changed the title [block by frontend]Add candidate_id limitation on schedule a aggregate [blocked by frontend]Add candidate_id limitation on schedule a aggregate Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
3 participants