-
Notifications
You must be signed in to change notification settings - Fork 44
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
Member data for State and District is confusing #277
Comments
Hi @tomburge - thank you for this feedback. It's very much appreciated. One possible workaround, if you are only looking for the current member for a particular district, is to use the "currentMember=True" filter. Here is an example call: https://api.congress.gov/v3/member/congress/118/TX/15?currentMember=true&api_key=[INSERT_KEY] I am in the process of updating sample documentation and adding the filter to the member endpoint parameters on api.congress.gov. You will see the documentation reflect this update in October. I hope this helps for now. Please let me know. |
The workaround makes sense if you are only concerned about current members. I didn't include the tests, but I ran into some issues with existing districts like Texas districts 1-10 with specific Congresses sometimes reporting no results and I have to wonder if no results were returned because a member was included on a response for another district. It was weird. |
@tomburge - yes, that is strange behavior, and I would like to investigate further. If you can recall any calls (I just tried Texas districts 1-10 for the 118th Congress and got results so maybe a previous Congress is the culprit?), please send them my way so I can take a look. I will keep digging in the meantime, too, to see if I can replicate this. Thanks for reporting this and following up! |
Here are three sets just checked. I wonder if redistricting has something to do with it. Has Results: No Results: Has Results: No Results: Has Results: No Results: |
Yes, looking at these examples redistricting is the culprit for these three, @tomburge - thank you for sharing these. I am going to have discussions on our end about this to see if there are particular element(s) we can add to make this a bit clearer. Thanks, again, for reporting this. |
I just looped through Congresses 97-118 and I got this: No member found for Congress: 97, District: 10, State: TX Looking at the Congress.gov site for members, I see this as well: The counts decrease farther back you go so it makes me think there may be an issue with the historical data or how it is presented. |
@tomburge - you are quite correct, when you deselect "118" you will see the numbers increase. Currently, when "118" is selected it is showing members who are in the 118th Congress AND those who were in previous Congresses, as well. See below: One possible solution, and something I intend to update our documentation with, is to add a "currentMember=False" filter to your call (e.g., https://api.congress.gov/v3/member/congress/97/TX/10?currentMember=False&api_key=INSERT_KEY). |
I just validated with the same loop and adding currentMember = False fixes the issue. Is it possible to add a default value of currentMember = False to the API to this call: GET /member/congress/:congress/:stateCode/:district? I would think if the API is being called with a specific Congress then the response would be expected to be populated with the members of that specific Congress whether they are current or not. |
@tomburge - Yes, we can update the documentation and API value to account for this. Thanks! |
I created a gist to showcase the following issue: https://gist.github.com/tomburge/d5b5f238eb5b51c3d14f222e6a744040
In the example1.json, this endpoint was used /member/{stateCode}/{district}.
In the example2.json, this endpoint was used /member/{bioguideId}.
In example1.json the query was for TX district 15. This returned 5 records.
3 had district 15, 1 had district 34, and 1 had no district.
In the example2.json, the member has 4 terms of which 3 are for district 15 and the current one is district 34.
It would be better (and less confusing) to have the district attribute inside of each term instead of a base attribute.
This would help with members who switched districts and for members who were in the House but then in the Senate.
The text was updated successfully, but these errors were encountered: