from google.cloud import bigquery project = 'dbaas-eng-bi' location = 'us-west2' client = bigquery.Client(project=project, location=location) client.query( """ SELECT * FROM `dbaas-eng-bi.user_behavior_analysis_new.all_clusters_dedicated_view` """ ).to_dataframe().to_pickle("{}.pkl".format('all_clusters_tenants_info'), compression="gzip") # client.query( # """ # SELECT * FROM `gcp-digital-bi.model_tidbcloud.dwm_dbaas_clusters` # """ # ).to_dataframe().to_json('dwm_dbaas_clusters.json', orient='records') # # client.query( # """ # SELECT * FROM `gcp-digital-bi.model_tidbcloud.dwm_dbaas_projects` # """ # ).to_dataframe().to_json('dwm_dbaas_projects.json', orient='records')