FR-001checkpassingA generic test MUST be a value with the level it is written at (a column or a model) and the type of its arguments; a test of one level MUST NOT compile on the other, and a test whose arguments are missing MUST NOT compile.
0052-sql-quality · owner if · domain data
FR-001checkpassingA generic test MUST be a value with the level it is written at (a column or a model) and the type of its arguments; a test of one level MUST NOT compile on the other, and a test whose arguments are missing MUST NOT compile.
FR-002checkpassingA test MUST take the name dbt gives it (the test, the relation, the column, the arguments), a long name MUST be made short, and a selection MUST pick by tag, relation, test and kind and leave out what it excludes.
FR-003checkpassingA use MUST be configured by severity, warnIf, errorIf, where, limit, failCalc, stored failures, schema, alias, tags, meta, enabled and name.
FR-004checkpassingThe status of a count MUST be judged as dbt does: with severity error a count that meets errorIf fails and below it one that meets warnIf warns; with severity warn either threshold warns.
FR-005checkpassingThe built-in tests (not_null, unique, accepted_values, relationships) and the package tests (expression_is_true, unique_combination_of_columns, not_empty_string, accepted_range, at_least_one, not_constant, equal_rowcount, equality) MUST give the rows that are wrong, and singular tests MUST be SQL of one's own.
FR-006checkpassingTests MUST run through a driver on SQLite, DuckDB and PostgreSQL and count the rows that are wrong, and a test that cannot run MUST be an error.
FR-007checkpassingwhere, limit and failCalc MUST apply, failures MUST be stored as a table or a view that a later run replaces, and a disabled test MUST be skipped.
FR-008checkpassingResults MUST be counted (a warning is not a failure) and told as TAP.
FR-009checkpassingThe tests a schema's state asks for (not null, keys, codes) MUST be made from it and pass on a database that holds the schema.
FR-010checkpassingA test MUST be able to expect an exact number of failing rows (exactly(n)): it MUST fail where the count is any other, fewer or more, and MUST never be a warning; exactly(0) is the ordinary test.
FR-011checkpassingpreview MUST run a set of proposed tests on the data that is already in a database and report, for each, its status, how many rows would be wrong and up to a given number of them, MUST report a test that cannot run as an error, and MUST change nothing.
SC-001success criterionEach requirement above is proved by a test that runs on real engines, and bun run verify is green.
Data, sql/quality/derive, sql/quality/generic, sql/quality/run, sql/quality/test, sql-loads