Skip to content

Downloading House votes in 2001 and 1991 raises exception #275

Open
@Andrew-Chen-Wang

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions