Skip to content

Instantly share code, notes, and snippets.

View maxthemanager's full-sized avatar

maxthemanager

View GitHub Profile
@maxthemanager
maxthemanager / gist:2e8932ec38f511d3f9380bf65d4a0aab
Last active April 8, 2026 12:19
Creating a dataset and table
import os
from google.cloud import bigquery
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = r'D:\Work\Flyaps\Demo\BQ_service_account.json'
client = bigquery.Client()
dataset_id = "peerless-text-365915.Demo_dataset_python"
dataset = bigquery.Dataset(dataset_id)
dataset.location = "europe-west3"
client.create_dataset(dataset, timeout=30)
table_id = f"{dataset_id}.industry"
job_config = bigquery.LoadJobConfig(source_format=bigquery.SourceFormat.CSV, autodetect=True)