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
search_issues() result has totalCount maxed out to 1000 #1309
Comments
this may be some limit in number of pages the search will support... pretty much most of my test runs return 1000 where there are 10 pages of 1000 entries. |
possible to set this high priority, thanks. |
@djwgit, Not sure I'm following what you are saying? Are you wanting this issue made a high priority issue or are you suggesting there is something I could do in my code to make my search request high priority? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I guess I had an open question to @djwgit. Wasn't sure if this person wanted me to mark this issue as high? |
@dleach02 |
Yes, my work around is doing the same thing. Time slice the search request. Time permitting, I was also going to investigate the v4 API to see if that would be easier... but would like a nice python wrapper ;-) |
Just bumped into this too - thought it was an issue w/ the PyGithub library, but it looks like it's just a github api limitation
https://docs.github.com/en/free-pro-team@latest/rest/reference/search |
So just fyi, if I am understanding the bug correctly, I think there is a simple workaround: results = g.search_repositories('test')
results.get_page(0)
print('total: ' + str(results.totalCount)) Basically if you call |
What I would recommend the library author do is to store the If the search results in less than 1k results, then that value matches the |
any updates? |
Hey,
I am not sure what happens! The number on the third try might be the correct value, but there is no way to verify that. |
The paginated list returned from a search_issues() will report a totalCount that maxes out to 1000 when a search query results in more than 1000 items. The totalCount() method in PaginatedList() will get headers and data from result of a requester.requestJsonAndCheck() using the first URL. The logic then tests to see if 'link' is not in headers which in my case there is a 'link' so it falls to the else side and parses the lastUrl line for 'page' which is 1000.
Problem though is that in my search, the original 'data' structure has a valid 'total_count' field of 3041 so I'm not sure why the logic tries to derive something from the lastUrl which is generating an incorrect value?
And if I iterate through the PaginatedList returned I count only 1020 items so I'm not able to iterate through all 3041 items. Note that I put rate limiting code in the iteration loop to sleep checking on get_rate_limit().search.remaining to go nonzero.
The text was updated successfully, but these errors were encountered: