Downloading House votes in 2001 and 1991 raises exception #275
Open
Description
Note: I ran the ./votes
command for 2001 and 1991
Two house members for each date 2001 and 1991 have the same first, middle, and last name. This is the 2001 data point:
{'C000488': {'type': 'rep', 'start': '1999-01-06', 'end': '2001-01-03', 'state': 'MO', 'district': 1, 'party': 'Democrat'}, 'C001049': {'type': 'rep', 'start': '2001-01-03', 'end': '2003-01-03', 'state': 'MO', 'district': 1, 'party': 'Democrat'}}
Note that they start and end on the same date. This exception is raised when you run:
from .utils import lookup_legislator
from datetime import datetime
lookup_legislator(107, "rep", "Clay", "MO", "D", datetime(year=2001, month=1, day=3), "bioguide")
A solution to this is to check if the multiple matches have the same date for start for one member as the other member's end date. If so, then choose the member that has the latter date because we can compare the date string of the when with each member's start and end.
The only thing that worries me is this comment:
# This is a possible match. Remember which term matched, but because of term overlaps
# on Jan 3's, don't key on the term uniquely, only on the moc.
Does that mean a representative going out can vote on the same day one comes in?
Metadata
Assignees
Labels
No labels