Open Andrew-Chen-Wang opened 3 years ago
Does that mean a representative going out can vote on the same day one comes in?
Of course. In the general case, a member might resign after a vote on the same day another member elected by special election is sworn in. In the more specific Jan 3 case, there can be a vote in the morning of Jan 3 and a vote in the afternoon of Jan 3 and those would be in different Congresses with a (overlapping but) totally different set of legislators serving.
In this particular case, it's a father-son pair.
To help debugging, the issue you found can be reproduced by running one of:
./run votes --chamber=house --congress=107 --session=2001
./run votes --vote_id=h2-107.200
This was all working at some point because this is how I got the vote data into GovTrack in the first place, but something must have broken.
The way to properly resolve this is for us to compare the congress number of the vote to the congress numbers that the matched terms are for, but the latter needs to be computed (there is a function named get_term_congresses but I can't say if it is correct).
Thanks for responding quickly. IIRC, from the congress-legislators repo, there was an XML file that included a tag <congress id="Congress number">
. I just can't recall where I saw this or which link gets all congressmen data. Which link are we getting all the historical Congressmen from?
In that case, we can then update the files with that new data point, congress
It reads the YAML files at https://github.com/unitedstates/congress-legislators/. (I don't think the XML file you are describing comes from these repos.)
This repo reads the files stored in that repo. But I was wondering which files that repository collects, not this one.
We scrape several sources in that repository. I don't remember off hand what all of the URLs are. But you can scan through the scripts at https://github.com/unitedstates/congress-legislators/tree/main/scripts to see.
For this issue, we can also go an easier route to solve it and just hard code the right bioguide ID to use for each of these votes.
Note: I ran the
./votes
command for 2001 and 1991Two house members for each date 2001 and 1991 have the same first, middle, and last name. This is the 2001 data point:
Note that they start and end on the same date. This exception is raised when you run:
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:
Does that mean a representative going out can vote on the same day one comes in?