import pandas as pd # to load it into Pandas DataFrame from google.cloud import bigquery from google.oauth2 import service_account YYYYMM = 202411 # let's download only November 2024 data LIMIT = 5 # limit the query to only first 5 results to reduce risk client = bigquery.Client() # this will fail if you have not set GOOGLE_APPLICATION_CREDENTIALS query = f"SELECT * FROM `chrome-ux-report.experimental.country` WHERE yyyymm = {YYYYMM} LIMIT {LIMIT}" df = client.query(query).to_dataframe() print('Dataframe:') print(df) print('Dataframe columns:') print(df.columns) df.to_csv(f'crux_all_{YYYYMM}.csv')