How levavasseuryann/dbt-bigquery works
This is a dbt project for transforming BigQuery HR data into tested, consumer-ready employee and department analytics. Its principal workflow cleans declared employee sources, enriches them with department targets, and materializes department and employee marts; a separate snapshot captures employee history. The project also documents source freshness, model contracts, business-rule tests, reusable macros, and an ad-hoc analysis query. The README documents model and seed relationships, but source excerpts were unavailable, so links beyond those documented are omitted.
Main entry points: int_employees_enriched.sql Employee Enrichment · dim_departments.sql Department Dimension · fct_employees_active.sql Active Employees · fct_employee_headcount_monthly.sql Monthly Headcount
Components 19
Warehouse Inputs
- BigQuery Sources
- Department Targets
seeds/department_targets.csv - Source Definitions
models/staging/_sources.yml
Data Models
- Employee Staging
models/staging/stg_employees.sql - Employee Enrichment
models/intermediate/int_employees_enriched.sql - Department Dimension
models/marts/dim_departments.sql - Active Employees
models/marts/fct_employees_active.sql - Monthly Headcount
models/marts/fct_employee_headcount_monthly.sql
Quality and History
- Employee SCD2 History
snapshots/snp_employees.sql - Seed Validation
seeds/_schema.yml - Source Freshness
models/staging/_sources.yml - Model Tests
models/marts/_schema.yml - Business Rule Tests
tests/assert_no_future_hires.sql - Recent Update Test
tests/assert_recent_source_updates.sql - Custom Generic Test
macros/test_non_negative.sql
Project Capabilities
- Run Start Hook
macros/log_project_context.sql - Run Results Summary
macros/summarize_run_results.sql - Employee KPI Analysis
analyses/employee_kpis.sql
Other components
- Analytics Consumers
Connections 19
- BigQuery Sources → Employee Staging: reads
- Source Definitions → BigQuery Sources: declares sources
- Employee Staging → Employee Enrichment: feeds
- Department Targets → Employee Enrichment: enriches
- Employee Enrichment → Department Dimension: feeds
- Employee Enrichment → Active Employees: feeds
- Employee Enrichment → Monthly Headcount: feeds
- BigQuery Sources → Employee SCD2 History: captures history
- Department Targets → Seed Validation: validated by
- BigQuery Sources → Source Freshness: freshness checked
- Department Dimension → Model Tests: contracted and tested
- Active Employees → Model Tests: contracted and tested
- Monthly Headcount → Model Tests: contracted and tested
- BigQuery Sources → Business Rule Tests: checked for future hires
- BigQuery Sources → Recent Update Test: checked for stale updates
- Employee KPI Analysis → Analytics Consumers: supports analysis
- Department Dimension → Analytics Consumers: serves
- Active Employees → Analytics Consumers: serves
- Monthly Headcount → Analytics Consumers: serves