From 8144a69b84230c4e252e57f88d72d425d5c3732e Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Mon, 22 Aug 2016 10:34:15 -0700 Subject: [PATCH] Address post-review comments for BigQuery samples Change-Id: I74627bc2744d3b0946d34c1d2a04c424ed708e87 --- bigquery/cloud-client/snippets.py | 3 +++ bigquery/cloud-client/snippets_test.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bigquery/cloud-client/snippets.py b/bigquery/cloud-client/snippets.py index bcf534c8d341..49272965b416 100644 --- a/bigquery/cloud-client/snippets.py +++ b/bigquery/cloud-client/snippets.py @@ -104,6 +104,9 @@ def list_rows(dataset_name, table_name, project=None): rows = [] page_token = None + # Load at most 25 results. You can change this to `while True` and change + # the max_results argument to load more rows from BigQuery, but note + # that this can take some time. It's preferred to use a query. while len(rows) < 25: results, total_rows, page_token = table.fetch_data( max_results=25, page_token=page_token) diff --git a/bigquery/cloud-client/snippets_test.py b/bigquery/cloud-client/snippets_test.py index 0a52922b9ac7..ed2f47639fc3 100644 --- a/bigquery/cloud-client/snippets_test.py +++ b/bigquery/cloud-client/snippets_test.py @@ -40,7 +40,7 @@ def test_list_datasets(capsys): def test_list_tables(capsys): - # Requires teh dataset and table to have been created in the test project. + # Requires the dataset and table to have been created in the test project. snippets.list_tables(DATASET_ID) out, _ = capsys.readouterr()