Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

python-gitlab Issue #63 - implement pagination for list()#64

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpocentek merged 3 commits intopython-gitlab:masterfromjantman:issues/63
Aug 21, 2015

Conversation

jantman
Copy link
Contributor

This implements iteration/pagination of list() results for#63

@@ -26,6 +26,9 @@
import requests
import six

import logging
logger = logging.getLogger(__name__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Could you remove the logging code for this change? I'm not against adding some logging but I'd rather do it in another patch.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Done.

@jantman
Copy link
ContributorAuthor

I've removed the logging code as requested, and added unit tests for thecurrent implementation of just thenext link. However, I think I've hit a bit of a roadblock...

I have nothing against giving a choice to the user, but I'd much rather prefer the iteration to be the default, with disabling it an option. I guess this is personal preference, but I find it very annoying when an API client presents a method likeUsers() that only retrieves partial results without making that extremely clear.

I looked into turning this into a generator, but as far as I can tell, I'd need to drastically change how arguments and return values are passed around to get away from the current recursive pattern.

gpocentek pushed a commit that referenced this pull requestAug 21, 2015
python-gitlab Issue#63 - implement pagination for list()
@gpocentekgpocentek merged commit24d5035 intopython-gitlab:masterAug 21, 2015
@gpocentek
Copy link
Contributor

Thanks Jason.

I've merged your patch as is but I'll probably restore the default behavior to avoid surprises on updates (people will not expect to suddenly retrieve all the items).

@jantman
Copy link
ContributorAuthor

Ok, thanks! I'll keep an eye out for it, and update my code to use the pagination once it's released.

@gpocentekgpocentek mentioned this pull requestSep 19, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@jantman@gpocentek@dserodio

[8]ページ先頭

©2009-2025 Movatter.jp