Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Documentation Issue] table.fetch_data(max_results=100) #1980

Copy link
Copy link
Closed
@mchirico

Description

@mchirico
Issue body actions

Page Name: bigquery-usage
Release: a1b8066

Please note, the following documentation appears to be incorrect.
https://googlecloudplatform.github.io/gcloud-python/latest/bigquery-usage.html

Get rows from a table’s data:

from gcloud import bigquery
>>> client = bigquery.Client()
>>> dataset = client.dataset('dataset_name')
>>> table = dataset.table(name='person_ages')
>>> rows, next_page_token = table.fetch_data(max_results=100)  # API request
>>> for row in rows:
...     for field, value in zip(table.schema, row):
...         do_something(field, value)

Specifically the following line of code returns 3 values. It appears that total_rows is missing.

rows, next_page_token = table.fetch_data(max_results=100)  # API request

The documentation for table.fetch_data states the following:

returns: ``(row_data, total_rows, page_token)``, where ``row_data``
              is a list of tuples, one per result row, containing only
              the values;  ``total_rows`` is a count of the total number
              of rows in the table;  and ``page_token`` is an opaque

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.