python で BigQuery の検索結果を取得する方法のメモ。
from google.cloud import bigquery client = bigquery.Client() query = """ SELECT * FROM prj.ds.tbl LIMIT 1 """ bq_job = client.query(query) rows = bq_job.result() for row in rows: for k, v in row.items(): print(f'{k}: {v}')