google/cloud/bigquery/client.py
def list_rows(self, table, selected_fields=None, max_results=None,
                  page_token=None, start_index=None, retry=DEFAULT_RETRY):
        """List the rows of the table.

        See
        https://cloud.google.com/bigquery/docs/reference/rest/v2/tabledata/list

        .. note::

           This method assumes that the provided schema is up-to-date with the
           schema as defined on the back-end: if the two schemas are not
           identical, the values returned may be incomplete. To ensure that the
           local copy of the schema is up-to-date, call ``client.get_table``.

        :type table: One of:
                     :class:`~google.cloud.bigquery.table.Table`
                     :class:`~google.cloud.bigquery.table.TableReference`
        :param table: the table to list, or a reference to it.

        :type selected_fields:
            list of :class:`~google.cloud.bigquery.schema.SchemaField`
        :param selected_fields:
            The fields to return. Required if ``table`` is a
            :class:`~google.cloud.bigquery.table.TableReference`.

        :type max_results: int
        :param max_results: maximum number of rows to return.

        :type page_token: str
        :param page_token: (Optional) Token representing a cursor into the
                           table's rows.

        :type start_index: int
        :param page_token: (Optional) The zero-based index of the starting
                           row to read.

        :type retry: :class:`google.api_core.retry.Retry`
        :param retry: (Optional) How to retry the RPC.

        :rtype: :class:`~google.api_core.page_iterator.Iterator`
        :returns: Iterator of row data :class:`tuple`s. During each page, the
                  iterator will have the ``total_rows`` attribute set,
                  which counts the total number of rows **in the table**
                  (this is distinct from the total number of rows in the
                  current page: ``iterator.page.num_items``).

        """
        if selected_fields is not None:
            schema = selected_fields
        elif isinstance(table, TableReference):
            raise ValueError('need selected_fields with TableReference')
        elif isinstance(table, Table):
            if len(table._schema) == 0:
                raise ValueError(_TABLE_HAS_NO_SCHEMA)
            schema = table.schema
        else:
            raise TypeError('table should be Table or TableReference')

        params = {}
        if selected_fields is not None:
            params['selectedFields'] = ','.join(
                field.name for field in selected_fields)

        if start_index is not None:
            params['startIndex'] = start_index

        iterator = page_iterator.HTTPIterator(
            client=self,
            api_request=functools.partial(self._call_api, retry),
            path='%s/data' % (table.path,),
            item_to_value=_item_to_row,
            items_key='rows',
            page_token=page_token,
            next_token='pageToken',
            max_results=max_results,
            page_start=_rows_page_start,
            extra_params=params)
        iterator.schema = schema
        iterator._field_to_index = _field_to_index_mapping(schema)
        return iterator
List the rows of the table.

        See
        https://cloud.google.com/bigquery/docs/reference/rest/v2/tabledata/list

        .. note::

           This method assumes that the provided schema is up-to-date with the
           schema as defined on the back-end: if the two schemas are not
           identical, the values returned may be incomplete. To ensure that the
           local copy of the schema is up-to-date, call ``client.get_table``.

        :type table: One of:
                     :class:`~google.cloud.bigquery.table.Table`
                     :class:`~google.cloud.bigquery.table.TableReference`
        :param table: the table to list, or a reference to it.

        :type selected_fields:
            list of :class:`~google.cloud.bigquery.schema.SchemaField`
        :param selected_fields:
            The fields to return. Required if ``table`` is a
            :class:`~google.cloud.bigquery.table.TableReference`.

        :type max_results: int
        :param max_results: maximum number of rows to return.

        :type page_token: str
        :param page_token: (Optional) Token representing a cursor into the
                           table's rows.

        :type start_index: int
        :param page_token: (Optional) The zero-based index of the starting
                           row to read.

        :type retry: :class:`google.api_core.retry.Retry`
        :param retry: (Optional) How to retry the RPC.

        :rtype: :class:`~google.api_core.page_iterator.Iterator`
        :returns: Iterator of row data :class:`tuple`s. During each page, the
                  iterator will have the ``total_rows`` attribute set,
                  which counts the total number of rows **in the table**
                  (this is distinct from the total number of rows in the
                  current page: ``iterator.page.num_items``).

        
List the rows of the table.



This method assumes that the provided schema is up-to-date with the
schema as defined on the back-end: if the two schemas are not
identical, the values returned may be incomplete. To ensure that the
local copy of the schema is up-to-date, call ``client.get_table``.
List the rows of the table . This method assumes that the provided schema is up - to - date with the schema as defined on the back - end : if the two schemas are not identical the values returned may be incomplete . To ensure that the local copy of the schema is up - to - date call ` ` client . get_table ` ` .
def list_rows(self, table, selected_fields=None, max_results=None,
                  page_token=None, start_index=None, retry=DEFAULT_RETRY):
        if selected_fields is not None:
            schema = selected_fields
        elif isinstance(table, TableReference):
            raise ValueError('need selected_fields with TableReference')
        elif isinstance(table, Table):
            if len(table._schema) == 0:
                raise ValueError(_TABLE_HAS_NO_SCHEMA)
            schema = table.schema
        else:
            raise TypeError('table should be Table or TableReference')
        params = {}
        if selected_fields is not None:
            params['selectedFields'] = ','.join(
                field.name for field in selected_fields)
        if start_index is not None:
            params['startIndex'] = start_index
        iterator = page_iterator.HTTPIterator(
            client=self,
            api_request=functools.partial(self._call_api, retry),
            path='%s/data' % (table.path,),
            item_to_value=_item_to_row,
            items_key='rows',
            page_token=page_token,
            next_token='pageToken',
            max_results=max_results,
            page_start=_rows_page_start,
            extra_params=params)
        iterator.schema = schema
        iterator._field_to_index = _field_to_index_mapping(schema)
        return iterator
def list_rows ( self , table , selected_fields = None , max_results = None , page_token = None , start_index = None , retry = DEFAULT_RETRY ) : if selected_fields is not None : schema = selected_fields elif isinstance ( table , TableReference ) : raise ValueError ( 'need selected_fields with TableReference' ) elif isinstance ( table , Table ) : if len ( table . _schema ) == 0 : raise ValueError ( _TABLE_HAS_NO_SCHEMA ) schema = table . schema else : raise TypeError ( 'table should be Table or TableReference' ) params = { } if selected_fields is not None : params [ 'selectedFields' ] = ',' . join ( field . name for field in selected_fields ) if start_index is not None : params [ 'startIndex' ] = start_index iterator = page_iterator . HTTPIterator ( client = self , api_request = functools . partial ( self . _call_api , retry ) , path = '%s/data' % ( table . path , ) , item_to_value = _item_to_row , items_key = 'rows' , page_token = page_token , next_token = 'pageToken' , max_results = max_results , page_start = _rows_page_start , extra_params = params ) iterator . schema = schema iterator . _field_to_index = _field_to_index_mapping ( schema ) return iterator
List the rows of the table.
List the rows of the table .
"""List the rows of the table.

        See
        https://cloud.google.com/bigquery/docs/reference/rest/v2/tabledata/list

        .. note::

           This method assumes that the provided schema is up-to-date with the
           schema as defined on the back-end: if the two schemas are not
           identical, the values returned may be incomplete. To ensure that the
           local copy of the schema is up-to-date, call ``client.get_table``.

        :type table: One of:
                     :class:`~google.cloud.bigquery.table.Table`
                     :class:`~google.cloud.bigquery.table.TableReference`
        :param table: the table to list, or a reference to it.

        :type selected_fields:
            list of :class:`~google.cloud.bigquery.schema.SchemaField`
        :param selected_fields:
            The fields to return. Required if ``table`` is a
            :class:`~google.cloud.bigquery.table.TableReference`.

        :type max_results: int
        :param max_results: maximum number of rows to return.

        :type page_token: str
        :param page_token: (Optional) Token representing a cursor into the
                           table's rows.

        :type start_index: int
        :param page_token: (Optional) The zero-based index of the starting
                           row to read.

        :type retry: :class:`google.api_core.retry.Retry`
        :param retry: (Optional) How to retry the RPC.

        :rtype: :class:`~google.api_core.page_iterator.Iterator`
        :returns: Iterator of row data :class:`tuple`s. During each page, the
                  iterator will have the ``total_rows`` attribute set,
                  which counts the total number of rows **in the table**
                  (this is distinct from the total number of rows in the
                  current page: ``iterator.page.num_items``).

        """
Iterator of row data :class:`tuple`s. During each page, the
iterator will have the ``total_rows`` attribute set,
which counts the total number of rows **in the table
(this is distinct from the total number of rows in the
current page: ``iterator.page.num_items``).
Iterator of row data : class : ` tuple ` s . During each page the iterator will have the ` ` total_rows ` ` attribute set which counts the total number of rows ** in the table ( this is distinct from the total number of rows in the current page : ` ` iterator . page . num_items ` ` ) .
:class:`~google.api_core.page_iterator.Iterator`
self
table
the table to list, or a reference to it.
the table to list or a reference to it .
selected_fields
The fields to return. Required if ``table`` is a
:class:`~google.cloud.bigquery.table.TableReference`.
The fields to return . Required if ` ` table ` ` is a : class : ` ~google . cloud . bigquery . table . TableReference ` .
max_results
maximum number of rows to return.
maximum number of rows to return .
page_token
(Optional) The zero-based index of the starting
row to read.
( Optional ) The zero - based index of the starting row to read .
start_index
retry
(Optional) How to retry the RPC.
( Optional ) How to retry the RPC .