bigquery-bigframes
Generates Python code using BigQuery DataFrames (BigFrames). Use by default for any Python data task involving BigQuery, including data processing, analysis, and machine learning. Don't use for SQL-first workflows or the google-cloud-bigquery client library — use bigquery-basics.
- 0
- Installs
- —
- Rating
- —
- Success rate
- 3
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 9f37f2be22a4755c… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
BigFrames (BigQuery DataFrame) basics
BigFrames is a Python library that lets you take advantage of BigQuery data processing by using familiar Python APIs.
Dataframe API best practices
-
Stay in the Cloud: Perform data cleaning, transformation, and analysis via BigFrames methods to leverage BigQuery's scale rather than downloading data.
-
Prefer partial ordering mode: Enable partial ordering mode right after importing BigFrames. This speeds up data processing significantly by relaxing row-sequence constraints.
import bigframes.pandas as bpd bpd.options.bigquery.ordering_mode = 'partial' -
Use
peek()for data preview: Usepeek(n)to preview data instead ofhead(n).peek(n)randomly samplesnrows and is significantly faster.head(n)returns rows in strict order and fails inpartialordering mode unless the DataFrame has been explicitly sorted. -
Avoid materializing data locally: Methods like
to_pandas()download all data to client memory, bypassing BigQuery’s distributed computation and risking Out of Memory (OOM) errors. Do not materialize data locally unless:- The dataset is small enough to fit safely in memory.
- An error message explicitly requires local materialization.
-
Prefer Dataframe API over SQL queries: Do not write raw SQL queries via
read_gbq()if a DataFrame/Series method achieves the same result, as it breaks the Pandas abstraction and prevents lazy query execution. -
Accessors over UDFs/Lambdas:
- Use built-in accessors (e.g.,
df.col.str.*,df.col.dt.*) instead of remote User Defined Functions (UDFs). UDFs require extra resources and time to deploy. - Do not use lambdas with
Series.map()orDataFrame.apply(). These methods do not accept functions withoutudforremote_functiondecorators.
# Avoid: df["upper"] = df["name"].map(lambda x: x.upper()) # Prefer: df["upper"] = df["name"].str.upper() - Use built-in accessors (e.g.,
-
Schema Verification: Do not assume the schema of intermediate outputs. Proactively verify schemas using
.dtypesand inspect sample records usingdisplay()with.peek(). -
Visualization: Plot directly from the BigFrames DataFrame/Series when possible. BigFrames is compatible with Matplotlib and Seaborn. If direct plotting fails, use the
.plotaccessor. If the dataset is too large to plot, aggregate or sample the data before calling.to_pandas()to plot locally.
Machine Learning
- Use
bigframes.bigquery.mlpackage: Do not use Scikit-learn or other ML libraries with BigQuery DataFrames. Standard Scikit-learn models require bringing data into local client memory, whereasbigframes.bigquery.mldelegates training directly to BigQuery's scalable ML engine. Import functions frombigframes.bigquery.ml.
Reference Directory
- Linear Regression: Train a linear regression model to predict numerical values.
- Logistic Regression: Train a logistic regression model to predict boolean values.
BigFrames ML (Legacy)
The BigFrames ML package (bigframes.ml) is a legacy package that mimics the
scikit-learn API but is no longer recommended for new projects. Only use this
package if the user explicitly requests BigFrames ML.
- Legacy Imports: When legacy BigFrames ML is requested, import tools and
classes from
bigframes.mlinstead ofbigframes.bigquery.ml. - DataFrame Return on Prediction: Unlike Scikit-learn, BigFrames'
predict()method always returns a DataFrame containing both predictions and features, rather than a single series of predictions. - No
random_state: Do not pass arandom_stateargument when instantiating BigFrames ML models, as this parameter is not supported in the BigFrames ML package. - Automatic Scaling: Do not use
OneHotEncoderorStandardScalerunless explicitly requested, as scaling is handled automatically. - Hyperparameter Tuning: Write custom loops for hyperparameter tuning, as
BigFrames lacks
GridSearchCVorRandomizedSearchCV. - ARIMA Plus (Forecasting):
- Import from
bigframes.ml.forecasting. - Sort data chronologically and split around a timepoint before training.
- Ensure the prediction horizon is less than or equal to the training horizon.
- Import from
- PCA: BigFrames' PCA class lacks a
transform()method. Usepredict()instead. - Model Persistence: To persist a model, use
model.to_gbq(). To load a persisted model, usebpd.read_gbq_model().
Files
3- SKILL.md
b2927a59844.9 KB - references/linear_regression.md
bcd20a496a1.4 KB - references/logistic_regression.md
0627160ffa1.1 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from google/skills8
Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for st
Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available model
Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for run
Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when generating synthetic user scenarios, evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results be
Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate c
Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI). Use this skill when moving applications to Google Cloud, to leverage Cloud credits, or to unify inferencing with other Cloud infrastructure (IAM, billing, telemetry
Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.
Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.
Related database skillsscan passed
Prisma ORM patterns for TypeScript backends — schema design, query optimization, transactions, pagination, and critical traps like updateMany returning count not records, $transaction timeouts, migrate dev resetting the DB, @updatedAt skipped on bulk writes, and serverless connection exhaustion. Use
Use when the user wants to provision infrastructure or third-party services using Stripe Projects. Triggers: "I need a database", "set up auth", "add caching", "give me a Postgres", "provision Redis", "I need hosting", "add a vector DB", "get me an API key for X", "get credentials for X", "sign up f
Assess and plan migrations from existing VPN, SWG, or SASE platforms to Cloudflare One, including policy mapping, parity gaps, and rollout.
Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to
Builds and deploys Firebase SQL Connect (aka Firebase Data Connect) backends with PostgreSQL securely. Use when designing schemas with tables and relations, writing authorized queries and mutations, configuring real-time data updates, or generating type-safe SDKs. Use when you need a relational data
Amazon Redshift is NOT PostgreSQL — corrects PostgreSQL-derived LLM mistakes; covers Redshift-specific SQL, DDL, COPY/UNLOAD, system views, metadata discovery, and operational patterns. Applies ONLY when the task is about Redshift itself (cluster, Serverless workgroup, or Redshift SQL). Pushes back