Skip to content

dbt Development

Targets

Four targets are available for school projects (kipptaf, kippnewark, kippcamden, kippmiami, kipppaterson):

Target Purpose
defer Default. Sources in zz_<user>_*, cross-regional sources read from prod. Power User --defer resolves unchanged models to prod manifest.
dev Full isolation. Cross-regional sources also in personal namespace. Use when developing regional models and testing end-to-end through kipptaf.
staging CI-equivalent builds. Sources in zz_stg_*. Used by dbt Cloud CI.
prod Production. Default target in shipped profiles (Dagster). Developers use defer (default in .dbt/profiles.yml).

Power User --defer

Power User's deferToProduction setting is currently disabled (deferToProduction: false in .vscode/settings.json) due to an incompatibility between Power User v0.60.1 and dbt 1.11.7 (merge_from_artifact crash). Re-enable when Power User is updated.

For CLI defer, use:

uv run dbt build \
  --select <model> \
  --project-dir src/dbt/<project> \
  --profiles-dir .dbt \
  --defer --state /workspaces/teamster/src/dbt/<project>/target/prod \
  --favor-state

Prod manifests are generated by the post-merge git hook (runs on every git pull/merge to main).

Staging external sources

External tables must be staged (created/refreshed via DDL) before any dbt model that depends on them can build. dbt build does not stage sources — Dagster handles this in production, but dbt Cloud CI does not.

If your PR adds or modifies an external source, you must stage it with --target staging before the CI job runs. The zz_stg_* tables persist across PRs, so this only needs to happen when a source definition actually changes.

Use the VS Code task dbt: Stage External Sources — it prompts for project, target (defer/dev/staging), and source selection.

Terminal equivalent:

uv run dbt run-operation stage_external_sources \
  --project-dir src/dbt/<project> \
  --target <target> \
  --vars '{"ext_full_refresh": "true", "cloud_storage_uri_base": "gs://teamster-<project>/dagster/<project>"}' \
  --args 'select: <source>'

Warning

run-operation does not support --defer or state:modified — there is no way to stage only changed sources automatically. Target the specific sources you changed (e.g., --args 'select: amplify.my_new_table') rather than staging everything.

Cross-project development

When modifying regional models and testing through kipptaf:

  1. Develop the regional project with --target defer — outputs go to zz_<user>_kippnewark_* (or the relevant region).
  2. In kipptaf, use --target dev — cross-regional sources resolve to zz_<user>_kippnewark_*.
  3. Test end-to-end locally.

Stale dev schemas

Your zz_<user>_* datasets in BigQuery accumulate over time. Drop them when you want a clean slate.