Checks and severity
This document describes the validation checks implemented in Floe, the supported
column types for casting, and how policy.severity applies to each check.
For the full execution order (file-level vs row-level vs entity-level), see
How Floe works.
Checks
Section titled “Checks”not_null (missing value)
Section titled “not_null (missing value)”- Trigger:
schema.columns[].nullable: false - Logic: a row fails when the typed value is null.
- Notes:
- Nulls include explicit nulls and any values listed in
source.options.null_values. - Applies to every column with
nullable: false.
- Nulls include explicit nulls and any values listed in
unique (dataset-level)
Section titled “unique (dataset-level)”- Trigger:
schema.unique_keys(each entry is one single- or multi-column key) and/orschema.primary_key(enforced as one more composite key). - Logic: the first occurrence is accepted; any later duplicate values are flagged.
- Notes:
- Null values are ignored (they do not count as duplicates).
- Applies independently per key, across all input files in the entity.
- The legacy
schema.columns[].uniqueflag was removed in 1.0:floe validateandfloe runfail on it. Useschema.unique_keys, e.g.unique_keys: [[order_id]].
cast_error (type mismatch)
Section titled “cast_error (type mismatch)”- Trigger: any column whose logical type is not
string. - Logic: a row fails when the raw value is present but the typed value is null.
- Notes:
- In
cast_mode: strict, cast errors are reported. - In
cast_mode: coerce, cast errors are ignored (values become null and may still failnot_nullif the column is required).
- In
Value checks: out_of_range, not_allowed, pattern_mismatch, length
Section titled “Value checks: out_of_range, not_allowed, pattern_mismatch, length”Optional keys on a column, each checked on the typed value:
| Keys | Rule | Column types | A row fails when |
|---|---|---|---|
min, max |
out_of_range |
int, float, decimal, date, datetime | the value is below min or above max (both inclusive); NaN always fails |
allowed_values |
not_allowed |
int, string | the value is not in the list |
pattern |
pattern_mismatch |
string | the value does not match the whole pattern |
min_length, max_length |
length |
string | the number of characters (Unicode code points) is outside the bounds |
columns: - name: amount type: decimal(18,2) min: 0 max: "99999999.99" # quote exact decimals - name: order_date type: date min: "2000-01-01" - name: country type: string allowed_values: [FR, DE, US] pattern: "[A-Z]{2}" # full match: Floe adds the anchors min_length: 2 max_length: 2- Bounds and
allowed_valuesare converted like a value of the column: a bound accepts exactly what a CSV value of that column does (ISO date, ISO datetime normalised to UTC, exact decimal). - A null passes every value check (
nullabledecides nulls), and a value that failed its cast is not reported again. patternuses the Rustregexsyntax that Polars runs, never Pythonre.- Error order on a row:
not_null,cast_error,out_of_range,not_allowed,pattern_mismatch,length,unique. Messages carry the config values only, never the row’s value. floe validaterefuses a key on a column type it does not apply to andminabovemax(config_conflict), and a bound or allowed value that does not convert, a NaN or infinite bound, and a pattern that does not compile (config_invalid_value).
Row predicates (schema.checks)
Section titled “Row predicates (schema.checks)”- Trigger: an entry of
schema.checks, which compares a column with another column (right) or a literal (value), optionally only on the rows where awhencondition holds. - Logic: a row fails when the comparison is false on its typed values.
- Notes:
- A comparison or
whenthat involves a null passes the row, as in SQLCHECK; useis_nullornot_nullto test for missing values. A row whosewhenis false passes. - The row error has
rule= the checkname,column=left, and a message rendered from the config (end_date >= start_date,amount == 0 when status == cancelled). Invalidation.rules[]each predicate is listed under its own name, after the column value rules. severitysets the level of one predicate; without it the predicate usespolicy.severity.- No
and/or, nesting or arithmetic: one comparison and at most onewhenper check. Field rules are in the config reference.
- A comparison or
policy: severity: rejectschema: columns: [...] checks: - name: end_after_start left: end_date op: ge # eq ne lt le gt ge, is_null not_null right: start_date # a column - name: discount_within_amount left: discount op: le right: amount severity: warn # keep the row, count a warning - name: vat_needs_country when: {left: vat_id, op: not_null} left: country op: not_null - name: no_cancelled_with_amount when: {left: status, op: eq, value: cancelled} # a literal left: amount op: eq value: 0Supported column types
Section titled “Supported column types”Type names are case-insensitive and normalized by removing - and _.
Examples of accepted values are listed below.
string:string,str,textboolean:boolean,boolinteger:int8,int16,int32,int64int,integer,long
unsigned integer:uint8,uint16,uint32,uint64
number(float64):number,float64,float,double
decimal(p,s)(exact; see Supported column types)float32:float32date:datedatetime:datetime,timestamp
Severity behavior
Section titled “Severity behavior”The configured policy.severity applies uniformly across all checks:
warn- Rows are kept.
- Errors are logged for each failed check.
reject- Rows with any check failure are rejected.
- For
unique, the first occurrence is kept, duplicates are rejected.
abort- Any check failure aborts the entire file (file-level rejection).
All modes avoid logging raw row values; only rule, column, row index, and message are emitted in reports.
Severity per check
Section titled “Severity per check”policy.severity is the default. A rule can override it, on one column
(schema.columns[].rule_severity: not_null, cast_error, out_of_range,
not_allowed, pattern_mismatch, length) or for the whole
entity (policy.rule_severity: the column rules as defaults, plus unique and
schema_mismatch). The level of a check is the column’s entry, else the
entity’s, else policy.severity.
policy: severity: reject # default for every check rule_severity: schema_mismatch: warn # a requested reject_file only warns and fills nulls unique: abort # a duplicate key aborts the entityschema: mismatch: missing_columns: reject_file primary_key: [order_id] columns: - name: order_id type: int64 - name: amount type: decimal(18,2) # cast_error -> reject (the default) - name: email type: string nullable: false rule_severity: not_null: warn # a missing email keeps the row and counts a warningA row is rejected if any failed check resolves to reject or abort; a row
that only fails warn checks is kept and counted as a warning. Any
abort-level failure aborts the file. sink.rejected is required as soon as
any rule can resolve to reject or abort, and abort is refused with pii.
unique is one rule for every key: severity per key is not supported.
Design notes
Section titled “Design notes”- Row-level rejection is the default because it preserves good data while isolating bad rows.
uniqueis dataset-level and enforced bypolicy.severity:warn: log duplicates and keep all rows.reject: keep the first occurrence, reject duplicates.abort: abort the file if duplicates are found.
- In
appendmode,uniquechecks seed from existing accepted data for the supported accepted sinks, so duplicates across runs can be rejected. cast_modedefines parsing behavior:strict: invalid values cause rejection (or abort per policy).coerce: invalid values become null; nullable rules decide acceptance.
Synced from floe @ v1.1.0 (313b534), docs/concepts/checks.md.