You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fd4ba57
Browse filesBrowse the repository at this point in the historyBrowse files
fix(build): audit unread sources only with loading off or when selected
End-of-build source audits ran for every source no model read, on every
build, so a plain build over an unmanaged source with a missing table
failed. They now run only when loading is off (--no-load or
auto_load_sources = false), or for a source selected by name. With
loading on and no such selection, a source is audited only before a
model that reads it, as before.
An unbuilt model is now one that was not built and whose relation the
inspected warehouse does not hold, rather than one planned as a first
run, so a full refresh on a fresh warehouse skips the end audits over a
failed model.
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/cli/build.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ This replaces the former `sqb run` command. The full lifecycle (tests + audits)
91
91
92
92
1. Managed sources are loaded (unless `--no-load`, which audits their existing data instead)
93
93
2. Selected seeds are loaded
94
-
3. Source audits run before their dependent models (unless `--no-audits`)
94
+
3. Source audits run before their dependent models (unless `--no-audits`); with `--no-load`, or for a source selected by name, a source no model reads is audited at the end
95
95
4. SQL unit tests run before their target model (unless `--no-tests`)
96
96
5. Models are materialized in DAG topological order
97
97
6. Error-severity audits run against the staging table before promotion to the target (unless `--no-audits`)
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/concepts/audits.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -379,6 +379,11 @@ sources:
379
379
380
380
If a source audit with `error` severity fails, all downstream models that depend on that source are blocked. This lets you catch data quality issues at the source before any transformations run.
381
381
382
+
A source's audits run before the first model in the build that reads it. A source no selected model
383
+
reads is audited at the end of the build only when loading is off (`--no-load` or
384
+
`auto_load_sources = false`) or when the source is selected by name, such as
385
+
`sqb build --select raw_orders`; otherwise its audits do not run.
386
+
382
387
A source audit that reads other resources waits for them before any model that depends on the
383
388
source is built. It may read a model that is not built from the source; reading one that is fails
384
389
with `P005`. See [Audits that read other resources](#audits-that-read-other-resources).
Copy file name to clipboardExpand all lines: src/sqlbuild/.agents/skills/sqlbuild/references/docs/concepts/python-nodes/loaders.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -340,8 +340,8 @@ sqb build --reload
340
340
341
341
With loading off, through `--no-load` or `auto_load_sources = false`, no loader runs, even for a
342
342
source selected by name such as `sqb build --no-load --select raw_orders`. Managed sources in the
343
-
selection stay in the plan, and their audits check the data they already hold. A source outside
344
-
the selection is neither loaded nor audited.
343
+
selection stay in the plan, and their audits check the data they already hold, at the end of the
344
+
build if no model reads them. A source outside the selection is neither loaded nor audited.
345
345
346
346
When `--reload` is passed, `ctx.is_reload` is `True` in the loader function. This lets loaders implement different behavior for full reloads versus normal incremental loads.
0 commit comments