-
Notifications
You must be signed in to change notification settings - Fork 670
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -26,6 +26,9 @@ | |||
import requests | |||
import six | |||
|
|||
import logging | |||
logger = logging.getLogger(__name__) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I've removed the logging code as requested, and added unit tests for the current implementation of just the 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 like 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. |
python-gitlab Issue #63 - implement pagination for list()
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). |
Ok, thanks! I'll keep an eye out for it, and update my code to use the pagination once it's released. |
This implements iteration/pagination of list() results for #63