- Install the SDK:
pyproject.toml
dependencies = [
"google-cloud-bigquery[bqstorage, pandas]",
]
- Create a BigQuery client:
client.py
from google.cloud import bigquery
bq_client = bigquery.Client(project="project")
- Execute your query and store the result:
query.py
query = """
SELECT column_one, column_two
FROM bq_table
WHERE column_three = true
"""
df = bq_client.query(query).to_dataframe()