drift_compare

Two profiles compared per column (PSI, KS, JS, Wasserstein) with thresholds as parameters.

QueryDeterministic

Flags

Flag Value
Kind query: reads values
Rows one result, not a table
Deterministic yes
Order matters no
Decomposable no
Makes no value

Parameters

Parameter Type Required Notes
reference reference yes A value's reference.
current reference yes A value's reference.
bins integer no at least 2, at most 1000
psi_warn number no at least 0
psi_error number no at least 0
p_value number no at least 0, at most 1
response_format "concise" | "detailed" no The byte budget: 64 KiB concise, 512 KiB detailed.

Example

Over the example tables orders; ${input:name} is an input's reference and ${verb} the value an earlier call made.

JSON
table_fetch {
  "table": "${input:orders}",
  "count": 120
}

table_fetch {
  "table": "${input:orders}",
  "offset": 120
}

drift_compare {
  "reference": "${table_fetch#0}",
  "current": "${table_fetch}"
}

Result

compared

JSON
{
  "columns": "…",
  "skipped": [
    {
      "name": "tags",
      "reason": "a type drift does not compare"
    }
  ],
  "driftedShare": 0.1111111111111111,
  "datasetDrift": false
}

Diagnostics

A refusal comes back as ok: false with coded diagnostics; every code, with its fix, is on the diagnostics page. A parameter that does not match the schema above is ARG_INVALID, with the parameter's path.