-
Notifications
You must be signed in to change notification settings - Fork 3
gcs bigquerty python
ghdrako edited this page Oct 2, 2023
·
2 revisions
pip install google-cloud-bigquery
from google.cloud import bigquery
from google.oauth2 import service_account
credentials = service_account.Credentials.from_service_account_file('sa.json')
client = bigquery.Client(credentials=credentials)
query = 'SELECT * FROM `sales.mobile_sales` \
WHERE ... '
query_job = client.query(query)
rows = query_job.result()
for row in rows:
print(row.City,row.Total ....)
Test