aclu-national / elections-api

An API for retrieving locally-relevant structured data about US elections
https://elections.api.aclu.org/v2/
MIT License
30 stars 4 forks source link

Returning Rick Scott in v2/congress/legislators endpoints #16

Closed kokonakajima closed 4 years ago

kokonakajima commented 5 years ago

User Impact: Scorecard update

The v2/congress/legislators?session=116 and v2/congress/legislators?session=all endpoints don't contain Rick Scott (though they should, because he's currently in office). This probably has to do with the way the legislators are being retrieved via their term start/end dates in congress.py:

WHERE start_date >= '{start_date}' AND end_date <= '{end_date}'
OR start_date <= '{start_date}' AND end_date >= '{end_date}'
ORDER BY end_date DESC
'''.format(start_date=session['start_date'], end_date=session['end_date']))

Rick Scott's term start date, 2019-01-08, falls very slightly after the start of the congressional session, 2019-01-03, and his end date falls after end of the congressional session in 2021, so wouldn't be captured by that query.