python
Copy
import streamlit as st
from bigquery_auth import create_bigquery_client
import pandas as pd
# Initialize BigQuery client - uses your workspace's configuration
client = create_bigquery_client()
# Create your Streamlit interface
st.title("5X BigQuery Data Explorer")
# Example query - replace with your dataset and table names
query = """
SELECT column1, column2
FROM `your-project.dataset.table`
LIMIT 10
"""
if st.button("Run Query"):
try:
# Execute query
df = client.query(query).to_dataframe()
st.dataframe(df)
except Exception as e:
st.error(f"Query failed: {str(e)}")