Shape · Data quality and flow control

Gate

Passes data on only when a condition holds. The condition can test the data itself, a separate control table or a parameter. Otherwise everything after it is skipped and the run still succeeds. For example, publish only if the extract has rows.

Also known as: Only if, skip downstream

How it works

Open when picks the test. The data has matching rows checks the data input; the control input has matching rows checks the optional control input instead; both use the Conditions list (column, operator, and a Value, another Column or a boolean SQL Expression), combined with AND or OR, and with no conditions they simply ask whether there is any row at all. A parameter rule holds compares one column of the first row of the table wired into the params port with a value. When the gate is closed nothing is output: every node after it is marked skipped, with the Title in the badge, and the run still succeeds. A closed gate is not an empty table, so a sink behind it writes nothing rather than an empty file.

Inputs and outputs

Inputs

  • data — Table
  • control — Table

Outputs

  • data — Table

Settings

The Attributes panel of Gate, as in the app: the controls work, but nothing runs — there is no data behind it.

The same settings, as the Assistant writes them
{
  name?: string
  mode: "data"|"control"|"param"
  conditions: [{ column, operator: "="|"!="|">"|"<"|">="|"<="|"contains"|"is null"|"is not null"|"is empty"|"is not empty", value, rhsKind?: "value"|"column"|"expression", rhsColumn?, rhsExpression? }]
  combinator: "AND"|"OR"
  paramColumn?: string
  paramOperator?: string
  paramValue?: string
}

passes the data input through unchanged when the condition holds; otherwise everything downstream is SKIPPED (not failed) and the run stays green. rhsKind "expression" = rhsExpression is a raw boolean DuckDB SQL fragment used as the whole condition, e.g. "amount > target * 1.1". "data" = the data has at least one row matching conditions (no conditions = has any rows); "control" = the same test on the optional `control` input; "param" = paramColumn paramOperator paramValue on row 0 of the table wired into the params port

Example

Publish only when the extract has rows: Open when set to the data has matching rows, no conditions, and a Write to DB after the gate. To send an alert only on big days, add a condition amount > 10000 instead.