-
Notifications
You must be signed in to change notification settings - Fork 322
Closed
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
The start_index option is ignored when the page_size option is used (or possible just multiple pages):
from google.cloud import bigquery
start_index = 10
query_job = bigquery.Client().query(
"SELECT word FROM `bigquery-public-data.samples.shakespeare` LIMIT 50;",
job_id_prefix="test_query_w_start_index_",
)
# check the normal row iterator
result = query_job.result(start_index=start_index, page_size=10)
print(result.total_rows)
print(len(list(result))) # returns 50 not 40
# iterate over pages
result = query_job.result(start_index=start_index, page_size=10)
print(result.total_rows)
print(sum(len(list(page)) for page in result.pages)) # returns 50 not 40
Expected result is 40 rows returned (50 - 10).
bigqquery version 3.30.0
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.