Skip to content

Commit ab099c2

Browse files
committed
add docstring
1 parent c9883a5 commit ab099c2

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

google/cloud/bigquery/client.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,16 +2005,19 @@ def _get_query_results(
20052005
before using ``retry``. If set, this connection timeout may be
20062006
increased to a minimum value. This prevents retries on what
20072007
would otherwise be a successful response.
2008-
page_size (int):
2008+
page_size (Optional[int]):
20092009
Maximum number of rows in a single response. See maxResults in
20102010
the jobs.getQueryResults REST API.
2011+
start_index (Optional[int]):
2012+
Zero-based index of the starting row. See startIndex in the
2013+
jobs.getQueryResults REST API.
20112014
20122015
Returns:
20132016
google.cloud.bigquery.query._QueryResults:
20142017
A new ``_QueryResults`` instance.
20152018
"""
20162019

2017-
extra_params: Dict[str, Any] = {"maxResults": page_size, "startIndex": start_index}
2020+
extra_params: Dict[str, Any] = {"maxResults": page_size}
20182021

20192022
if timeout is not None:
20202023
if not isinstance(timeout, (int, float)):
@@ -2037,6 +2040,9 @@ def _get_query_results(
20372040
if location is not None:
20382041
extra_params["location"] = location
20392042

2043+
if start_index is not None:
2044+
extra_params["startIndex"] = start_index
2045+
20402046
path = "/projects/{}/queries/{}".format(project, job_id)
20412047

20422048
# This call is typically made in a polling loop that checks whether the

google/cloud/bigquery/job/query.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,9 @@ def _reload_query_results(
14221422
page_size (int):
14231423
Maximum number of rows in a single response. See maxResults in
14241424
the jobs.getQueryResults REST API.
1425+
start_index (Optional[int]):
1426+
Zero-based index of the starting row. See startIndex in the
1427+
jobs.getQueryResults REST API.
14251428
"""
14261429
# Optimization: avoid a call to jobs.getQueryResults if it's already
14271430
# been fetched, e.g. from jobs.query first page of results.

0 commit comments

Comments
 (0)