This method is deprecated. See the other table.to_* methods for different approaches to loading data.

For similar functionality but improved performance, see Table.to_arrow_table().to_pydict()

Table.list_rows(max_results=None, *, variables=None, progress=True) → list<namedtuple>

Return a list of rows in the table.


max_results : int, default None The maximum number of rows to return. If not specified, all rows in the table will be read.

variables : list<str> A list of variable names to read, improving performance when not all variables are needed. If unspecified, all variables will be represented in the returned rows. Variable names are case-insensitive, though the names in the results will reflect the variable's true casing. The order of the columns returned will correspond to the order of names in this list.

progress : bool, default True Whether to display a progress bar.




When calling list_rows, a python list of named tuples will be returned, allowing you to reference values in each row by either the variable name or offset. E.g.,:

rows = (
        SELECT 1 + 1 AS some_number, 'foo' AS some_string
        UNION ALL 
        SELECT 4, 'bar'
print(rows) # [Row(some_number='2', some_string='foo'), Row(some_number='4', some_string='bar')]
rows[0]["some_number"] # 2
rows[0][1]             # "foo"

Last updated