This question seems like it should be so simple to answer, but after days of research and several dead ends, I can\'t seem to get query results out of BigQuery
with
If you login locally with gcloud:
gcloud auth application-default login
Then a credentials file will be stored in ~/.config/gcloud/, which can be loaded with:
from oauth2client.client import GoogleCredentials
from apiclient.discovery import build
credentials = GoogleCredentials.get_application_default()
service = build('bigquery', 'v2')
Or you can just load the BQ security key file directly with:
from google.cloud import bigquery
client = bigquery.Client.from_service_account_json(path_to_key.json)