Skip to content

Commit 21e632f

Browse files
authored
Remove max_results argument from table.fetch_data() call.
The sample uses islice instead, which demonstrates that fetch_data returns an iterable.
1 parent 2db0c9c commit 21e632f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bigquery/cloud-client/snippets.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,8 @@ def list_rows(dataset_name, table_name, project=None):
125125
# Reload the table so that the schema is available.
126126
table.reload()
127127

128-
# Load at most 25 results per page. You can change the max_results
129-
# argument to load more rows from BigQuery at a time.
130-
rows = list(itertools.islice(table.fetch_data(max_results=25), 25))
128+
# Load at most 25 results.
129+
rows = list(itertools.islice(table.fetch_data(), 25))
131130

132131
# Use format to create a simple table.
133132
format_string = '{!s:<16} ' * len(table.schema)

0 commit comments

Comments
 (0)