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

candidates showing up outside their cycle #2628

Closed
2 tasks
LindsayYoung opened this issue Aug 28, 2017 · 7 comments
Closed
2 tasks

candidates showing up outside their cycle #2628

LindsayYoung opened this issue Aug 28, 2017 · 7 comments
Assignees
Labels

Comments

@LindsayYoung
Copy link
Contributor

LindsayYoung commented Aug 28, 2017

We made a lot of election fixes in #2590 but this is still outstanding.

Here is an example of two candidates that are listed because their fec_election_yr is 2018- because they have committees connected to them and should have a profile page for those years, but should not show up in the candidate results, because they don't have a cand_election_yr of 2018.

https://www.fec.gov/data/candidates/house/?cycle=2018&state=TX&district=07
H6TX07110
H6TX07110

This also needs a test that is sophisticated enough to catch this in the future. We have seen this a few times.

  • on profile pages show financial data if committee is still active
  • on election pages confirm candidate are running for office during the two-year period being displayed
@PaulClark2 PaulClark2 added this to the Sprint 3.6 milestone Sep 5, 2017
@PaulClark2 PaulClark2 modified the milestones: Sprint 4.2, Sprint 4.4 Nov 14, 2017
@jwchumley jwchumley modified the milestones: Sprint 4.4, Sprint 4.5 Nov 14, 2017
@PaulClark2 PaulClark2 removed this from the Sprint 4.5 milestone Nov 20, 2017
@PaulClark2
Copy link
Contributor

@jwchumley and @hcaofec can you investigate how widespread this issue is?

@jwchumley
Copy link
Contributor

Looks like the issue is with the candidate search endpoint (and maybe other candidate endpoints). the "cycle" data element is described as the two -year election cycle in which a candidate runs for office but what it seems to be doing in this case is using the committee's activity instead of the candidates election year to determine whether to include the candidate in the output or not. This is wrong. Cycle should ONLY look at the candidate's election year and not the committee's activity period.
@hcaofec could you look at the code and see if you can suggest a correction?

@hcaofec
Copy link
Contributor

hcaofec commented Nov 27, 2017

If these two candidates are not running for 2018, should they be inserted into cand_inactive table for that particular cycle?
@jwchumley @LindsayYoung

@PaulClark2
Copy link
Contributor

The candidate doesn't have a 2018 F2 row. I don't think cand_inactive is the solution.

The candidate election year is 2016 in the relevant tables. The candidate/committee pair correctly has a 2016 (candidate election year) /2018 (FEC election year) row in cand_cmte_linkage and cand_valid_fec_yr because the PCC is still active.

select election_yr, form_tp, cand_id, begin_image_num, sub_id, receipt_dt from disclosure.nml_form_2_2Z_view where cand_id = 'H6TX07110' order by receipt_dt desc;

select * from disclosure.cand_valid_fec_yr where cand_id = 'H6TX07110';

select * from disclosure.cand_cmte_linkage where cand_id = 'H6TX07110';

@hcaofec
Copy link
Contributor

hcaofec commented Nov 27, 2017

There is also a column 'candidate_status' returned by the API which has values like:
P STATUTORY CANDIDATE IN PRIOR CYCLE
C STATUTORY CANDIDATE
Can we use add 'if...else' logic to this page using this column
@jwchumley @PaulClark2 @LindsayYoung

@hcaofec
Copy link
Contributor

hcaofec commented Jan 19, 2018

Election page looks correct. These two candidates are not shown. ( H6TX07110, H6TX07128 )
https://www.fec.gov/data/elections/house/TX/07/2018/

@LindsayYoung
Copy link
Contributor Author

Thanks for getting this done! @hcaofec 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants