-
Notifications
You must be signed in to change notification settings - Fork 106
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
Committees pagination error #2690
Comments
What is supposed to happen is that the small requests use an exact count for the count returned and large requests use the count estimate because when we created that endpoint, a schedule A count could take take a minute and we couldn't add that to every call. This dichotomy broke down when we added efiling endpoints because they use the ApiResource directly instead of the ItemizedResource. It is possible that we could do queries to efiling without a big performance hit, but will have to do some testing first. It is also possible that the index improvements we have made would make an accurate count in a timely manner, but that would need testing as well. Ideally, we would be able to set the threshold per endpoint, it seems like we should be able to pass that in as a kwarg, but did not have success with that locally. |
Thanks, @LindsayYoung . I'll give this to @jwchumley for now. |
@jwchumley && @LindsayYoung However, when i added a committee_id=C00462390 to the existing query in the browser, only one record was found in DB and count is now set to 1. This is the behavior of API across all the endpoints. This seems to be right. |
This behavior is not correct. Prior to when we reported this bug, the behavior was for count to include the number of records in the search results. Try adding search parameter |
Thanks for ringing in, @girlprogrammer! @pkfec and I just looked at this and the problem was that we were returning the count estimate if the estimate was more than 5,000. That makes sense for other endpoints where the exact count can take minutes to execute, but not on small tables like this. We are going to increase the threshold for doing an exact count, so you should return the exact counts for the smaller tables. We can double check this is working as expected in our development server soon and ring in here. |
Thank you, @LindsayYoung and @pkfec! |
Initial reporter here: I have confirmed this is working correctly in production now. |
Thank you @girlprogrammer! |
It looks like the committees endpoint always returns the total count and not the count for the query.
https://api.open.fec.gov/v1/committees/
The text was updated successfully, but these errors were encountered: