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
Standalone audits are defined independently rather than being attached to a specific model. They specify the models they depend on using the `depends_on` property.
164
+
165
+
Unlike model-level audits, standalone audits can be used to validate data across one or more models without being associated with a single model.
166
+
167
+
Standalone audits run as scheduled nodes during both `sqlmesh plan` and `sqlmesh run`.
168
+
169
+
```sql linenums="1"
170
+
AUDIT (
171
+
name assert_item_price_is_not_null,
172
+
dialect spark,
173
+
standalone TRUE,
174
+
depends_on (
175
+
sushi.items
176
+
)
177
+
);
178
+
179
+
SELECT*
180
+
FROMsushi.items
181
+
WHERE
182
+
ds BETWEEN @start_ds AND @end_ds
183
+
AND price IS NULL;
184
+
```
185
+
186
+
In this example, the audit checks that the `price` column in `sushi.items` does not contain `NULL` values for the selected date range.
187
+
188
+
Standalone audits can declare dependencies using the `depends_on` property. SQLMesh can often infer dependencies directly from the audit query, but using `depends_on` is recommended when inference isn't sufficient.
189
+
190
+
!!! note
191
+
192
+
Standalone audits are non-blocking only. Because they are not associated with a single model, SQLMesh cannot determine which model should be blocked if the audit fails.
162
193
## Built-in audits
163
194
SQLMesh comes with a suite of built-in generic audits that cover a broad set of common use cases. Built-in audits are blocking by default, but they all have non-blocking counterparts which you can use by appending `_non_blocking` - see [Non-blocking audits](#non-blocking-audits).
Copy file name to clipboardExpand all lines: docs/guides/linter.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,7 @@ Here are all of SQLMesh's built-in linting rules:
74
74
|`invalidselectstarexpansion`| Correctness | The query's top-level selection may be `SELECT *`, but only if SQLMesh can expand the `SELECT *` into individual columns |
75
75
|`noselectstar`| Stylistic | The query's top-level selection may not be `SELECT *`, even if SQLMesh can expand the `SELECT *` into individual columns |
76
76
|`nomissingaudits`| Governance | SQLMesh did not find any `audits` in the model's configuration to test data quality. |
77
+
|`nomissingunittest`| Governance | SQLMesh did not find any `unit tests` associated with the model to test |
0 commit comments