dbt custom generic data test (this repo)
When to use
- Adding or changing a custom generic data test (
{% test my_test(model, column_name, ...) %}). - Wiring adapter.dispatch for warehouse-specific SQL (here: BigQuery).
- Adding macro schema docs (
macros:/test_<name>) or an integration_tests model +data_tests. - Debugging
test_<name>is undefined or shadowing between the package andintegration_tests.
When not to use
- Singular (data) tests in
tests/that are not reusable generic tests—use normal dbt test guidance. - Warehouse features unrelated to test macro structure.
Workflow (short)
- Read the official guide: Writing custom generic data tests (standard args, YAML usage, documenting
test_<name>). - Open the detailed checklist: references/checklist.md.
- Mirror the k_anonymity layout under
macros/generic_tests/<name>/and integration fixtures underintegration_tests/models/generic_tests/<name>/unless there is a reason not to. - Validate with
make run-unit-tests; usemake run-integration-testswhen SQL execution or BigQuery behavior changes (seeAGENTS.md).
This skill keeps SKILL.md short for discovery and puts procedural detail in references/checklist.md (progressive disclosure).
Canonical paths (examples)
| Concern | Example in repo |
|--------|-------------------|