What problem does it solve?
Manually writing unit tests for BigQuery SQL queries is time-consuming, error-prone, and complex, especially with intricate data structures and BigQuery-specific nuances. This skill automates the creation and management of these tests, preventing accidental production data queries and ensuring query logic is validated efficiently.
Core Features & Use Cases
- Automated Test Generation: Creates unit test fixtures (input, expected output, query parameters) for BigQuery SQL queries following
bigquery-etl conventions.
- Production Query Prevention: Proactively identifies and prevents tests from accidentally querying production data by ensuring all source tables have synthetic fixtures.
- Comprehensive Validation: Handles complex query patterns (JOINs, UNION ALL, nested structures, TIMESTAMP formats) and provides clear guidance for common test failures.
- Use Case: A data engineer modifies a complex BigQuery SQL query. Instead of manually updating dozens of test fixtures, they use this skill to automatically generate or update all necessary input and output YAML files, ensuring the new logic is validated without hitting production.
Quick Start
Generate unit tests for the BigQuery query located at sql/my-project/my-dataset/my-table/query.sql.
Ensure all source tables are covered with synthetic data.