(self, n=10)
return rows
Fetch and return a maximum of `n` rows from the source preview stream.
Fetch and return a maximum of `n` rows from the source preview stream.
Fetch and return a maximum of n rows from the source preview stream .
def __tryFetchRows(self, n=10):
        # type: (int) -> List[List[str]]
        """
        Fetch and return a maximum of `n` rows from the source preview stream.
        """
        rows = []
        for _ in range(n):
            try:
                row = next(self.__iter)
            except StopIteration:
                self.__canFetchMore = False
                break
            except Exception as err:  # pylint: disable=broad-except
                print("".join(traceback.format_exception(*sys.exc_info())),
                      file=sys.stderr)
                self.__error = format_exception(err)
                self.__canFetchMore = False
                break
            else:
                rows.append(row)
        return rows
def __tryFetchRows ( self , n = 10 ) : # type: (int) -> List[List[str]] rows = [ ] for _ in range ( n ) : try : row = next ( self . __iter ) except StopIteration : self . __canFetchMore = False break except Exception as err : # pylint: disable=broad-except print ( "" . join ( traceback . format_exception ( * sys . exc_info ( ) ) ) , file = sys . stderr ) self . __error = format_exception ( err ) self . __canFetchMore = False break else : rows . append ( row ) return rows