Skip to content

Commit d454a3d

Browse files
committed
Fix stopping condition
1 parent 7c0167e commit d454a3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bigquery/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def get_query_rows(self, job_id, offset=None, limit=None, timeout=0):
327327
records = [self._transform_row(row, schema) for row in rows]
328328

329329
# Append to records if there are multiple pages for query results
330-
while limit is None and page_token or len(records) < limit:
330+
while page_token and (not limit or len(records) < limit):
331331
query_reply = self.get_query_results(job_id, offset=offset, limit=limit,
332332
page_token=page_token, timeout=timeout)
333333
page_token = query_reply.get("pageToken")

0 commit comments

Comments
 (0)