Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

fjsj
Copy link
Member

@fjsj fjsj commented Nov 8, 2016

Closes #123

@fjsj fjsj changed the title Fix #123: simpler pagination with .pages() withour first .get Fix #123: simpler pagination with .pages() without first .get Nov 8, 2016
@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 91.104% when pulling ede522f on fjsj:fix-123-simple-pages into 275090f on vintasoftware:master.

Copy link
Contributor

@filipeximenes filipeximenes left a 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)
Copy link
Contributor

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,
Copy link
Contributor

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, "
Copy link
Contributor

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

@fjsj
Copy link
Member Author

fjsj commented Jun 6, 2023

Closing because this would be a major change in API.

@fjsj fjsj closed this Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify pagination
3 participants