in pyqldb/cursor/stream_cursor.py [0:0]
def __next__(self):
"""
Iterator function to implement the iterator protocol. Pulls the next page containing the results being
iterated on when the end of the current is reached.
:rtype: :py:class:`amazon.ion.simple_types.IonSymbol`
:return: The Ion value in the row that the cursor is on.
:raises StopIteration: When there are no more results.
"""
if not self._is_open:
raise ResultClosedError(self._session.token)
if self._index >= len(self._page.get('Values')):
if not self._are_there_more_results():
raise StopIteration
self._next_page()
while len(self._page.get('Values')) == 0 and self._are_there_more_results():
self._next_page()
if len(self._page.get('Values')) == 0:
raise StopIteration
row = self._page.get('Values')[self._index]
ion_value = self._value_holder_to_ion_value(row)
self._index += 1
return ion_value