-
Notifications
You must be signed in to change notification settings - Fork 51
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
Fix #123: simpler pagination with .pages() without first .get #131
Conversation
523afd4
to
ede522f
Compare
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.
We also need to update docs
else: | ||
# this mean .pages() was called before the first .get, | ||
# like `api.statuses_user_timeline().pages()` | ||
response = self.get(params=params) |
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.
Shouldn't we simply pass all the kwargs
?
Passing only the params will limit the options that can be passed in the request, a header for example.
"Pass params on the .get call instead.") | ||
executor = self | ||
else: | ||
# this mean .pages() was called before the first .get, |
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.
this means ...
def pages(self, max_pages=None, max_items=None, params=None, **kwargs): | ||
if self._response is not None: | ||
if params is not None: | ||
raise Exception("Since you're paging after the first .get call, " |
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.
Just improving the message:
You cannot pass new params after the first request is done. Use the ".get" method to pass parameters
Closing because this would be a major change in API. |
Closes #123