Shape · Data quality and flow control
Assert
Checks the data against rules, such as no blanks, unique keys, allowed values or freshness, and stops the run if one fails. Data that passes flows through unchanged.
Also known as: Test, validate
How it works
Each rule has a kind: Row count (min, max or exact), No nulls (one or more columns, with an optional tolerance as a share of rows, 0 by default), Columns present, Unique, Accepted values, Value range, Regex match (a partial match unless you anchor the pattern), Freshness (the column's newest value is within N minutes, hours or days of now), Geometry valid and Custom predicate (a boolean SQL expression every row must satisfy; a NULL result counts as a violation). A rule missing its column or value is ignored. With more than one rule an AND/OR toggle appears: AND fails the run when any rule is violated, OR only when every rule is. A failure names the rule, what was expected, what was found and up to five offending values. The node always runs on the desktop, never pushed down to a source.
Inputs and outputs
Inputs
data— Table
Outputs
data— Table
Settings
The Attributes panel of Assert, as in the app: the controls work, but nothing runs — there is no data behind it.
The same settings, as the Assistant writes them
{
rules: Rule[]
combinator: "AND"|"OR"
}where Rule = { kind: "row_count", min?: number, max?: number, exact?: number } | { kind: "not_null", columns: string[], maxNullRatio?: number } | { kind: "columns_present", columns: string[] } | { kind: "unique", columns: string[] } | { kind: "accepted_values", column: string, values: string[] } | { kind: "value_range", column: string, min?: number, max?: number } | { kind: "regex_match", column: string, pattern: string } | { kind: "freshness", column: string, maxAge: number, unit: "minutes"|"hours"|"days" } | { kind: "geometry_valid", column: string } | { kind: "custom_sql", expression: string } // custom_sql expression = a boolean DuckDB SQL predicate every row must satisfy (a NULL result counts as a violation), e.g. "end_date >= start_date"; regex_match pattern = an RE2 regex tested with regexp_matches, a partial match unless anchored, e.g. "^[A-Z]{2}[0-9]{4}$"
Example
Guard a customer load before it is written: Unique on customer_id, No nulls in email, Row count at least 1 and a Custom predicate signup_date <= CURRENT_DATE, combined with AND.