Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sample for fetching total_rows from query results. #7217

Merged
merged 2 commits into from
Jan 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Copypasta
  • Loading branch information
tswast committed Jan 30, 2019
commit 0f2e10ac54e701d7a56e4ffa8d18b57464cf1b8c
4 changes: 2 additions & 2 deletions bigquery/docs/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,7 @@ def test_client_query_legacy_sql(client):


def test_client_query_total_rows(client, capsys):
"""Run a query an just check for how many rows."""
"""Run a query and just check for how many rows."""
# [START bigquery_query_total_rows]
# from google.cloud import bigquery
# client = bigquery.Client()
Expand All @@ -2245,7 +2245,7 @@ def test_client_query_total_rows(client, capsys):
results = query_job.result() # Waits for query to complete.
next(iter(results)) # Fetch the first page of results, which contains total_rows.
print("Got {} rows.".format(results.total_rows))
# [START bigquery_query_total_rows]
# [END bigquery_query_total_rows]

out, _ = capsys.readouterr()
assert "Got 100 rows." in out
Expand Down