Skip to content

ResultSet: handle empty non-final pages on ResultSet iteration #102

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

Merged
merged 1 commit into from
Aug 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cassandra/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -5133,6 +5133,7 @@ def next(self):
if not self.response_future._continuous_paging_session:
self.fetch_next_page()
self._page_iter = iter(self._current_rows)
return self.next()
Copy link

Choose a reason for hiding this comment

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

@ultrabug this is identical to the next line after the if, how this fixes anything ?, do we have a test case to demonstrate this ?

Copy link

@haaawk haaawk Aug 30, 2021

Choose a reason for hiding this comment

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

It's not doing the same. It runs the whole method again (recursively). next(self) not only calls next(self._page_iter) but also has all the logic in lines 5127-5137.


return next(self._page_iter)

Expand Down