Skip to content

Commit 80b5a2b

Browse files
committed
BQ: Empty array when no results
Better than KeyError
1 parent 150439c commit 80b5a2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bigquery/api/sync_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def main(project_id, query, timeout, num_retries):
6666
pageToken=page_token,
6767
**query_job['jobReference']).execute(num_retries=2)
6868

69-
print(json.dumps(page['rows']))
69+
print(json.dumps(page.get('rows', [])))
7070

7171
page_token = page.get('pageToken')
7272
if not page_token:

0 commit comments

Comments
 (0)