get_issues() returns max. 250 items #33

Closed
bilderbuchi opened this Issue May 28, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@bilderbuchi

As the title says, get_issues() seems to return a max of 250 items.
It can't be a pagination thing I think because a page is max. 100 items long as per http://developer.github.com/v3/#pagination

Repro:

from github import Github
g = Github()
test=g.get_user('openframeworks').get_repo('openFrameworks').get_issues()
len(test)

This repo hast 940 closed and 340 open issues.

@jacquev6

This comment has been minimized.

Show comment Hide comment
@jacquev6

jacquev6 May 28, 2012

Member

You're definitively my best user ! I hope you will not get tired of discovering bugs and limitations in my library.

This issue is related to https://github.com/jacquev6/PyGithub/blob/master/github/Requester.py#L28 and the pageCount < 10: I've had to limit to 10 pages for some obscure reason I don't remember.

In version 1.0, get_issues (and other get_collections) will not return a Python list but a github.PaginatedList which will be iterable and not limited to 10 pages, (but you won't be able to call len on it).

Member

jacquev6 commented May 28, 2012

You're definitively my best user ! I hope you will not get tired of discovering bugs and limitations in my library.

This issue is related to https://github.com/jacquev6/PyGithub/blob/master/github/Requester.py#L28 and the pageCount < 10: I've had to limit to 10 pages for some obscure reason I don't remember.

In version 1.0, get_issues (and other get_collections) will not return a Python list but a github.PaginatedList which will be iterable and not limited to 10 pages, (but you won't be able to call len on it).

@ghost ghost assigned jacquev6 May 28, 2012

@bilderbuchi

This comment has been minimized.

Show comment Hide comment
@bilderbuchi

bilderbuchi May 28, 2012

I see. Is there a possibility to increase the number of items per page to work around this for now? This is in the API (with &per_page=100 according to API docs), but I'm unsure how to do this in PyGithub. Default is 25, max 100.

I see. Is there a possibility to increase the number of items per page to work around this for now? This is in the API (with &per_page=100 according to API docs), but I'm unsure how to do this in PyGithub. Default is 25, max 100.

@jacquev6

This comment has been minimized.

Show comment Hide comment
@jacquev6

jacquev6 May 28, 2012

Member

If you can't or don't want to modify PyGithub locally, I'm afraid you're stuck to 10 pages of 25 items, sorry.

If you can patch PyGithub, just increase/remove the limit on pageCount in Requester.py.

Be assured I will publish version 1.0 on next Monday, with all the things I promised :)

Member

jacquev6 commented May 28, 2012

If you can't or don't want to modify PyGithub locally, I'm afraid you're stuck to 10 pages of 25 items, sorry.

If you can patch PyGithub, just increase/remove the limit on pageCount in Requester.py.

Be assured I will publish version 1.0 on next Monday, with all the things I promised :)

@bilderbuchi

This comment has been minimized.

Show comment Hide comment
@bilderbuchi

bilderbuchi May 28, 2012

I see. I can either patch it locally, or just wait for next week. It will take a while until I get all the other work done, waiting for 1.0 probably won't delay me at all.

I see. I can either patch it locally, or just wait for next week. It will take a while until I get all the other work done, waiting for 1.0 probably won't delay me at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment