Hydra ETL
Build your first job
Hydra DSL7 · Expressionsfilter.expr
Grammar element · filter.expr

filter.expr decides which rows continue

Three valid pandas-query expressions. Each returns a boolean decision for every current row.

transformations.yaml4 steps

      
What the expression returns

A true or false decision per row, evaluated against columns in the current frame.

✓ 6 rows match

What filter.expr is

filter.expr is a boolean expression evaluated once across the current table to decide which rows continue.

It is not validated against runtime column types by hdrctl validate. Earlier steps must prepare both names and types before the filter runs.

What it contains

  • Current column names — Resolved by pandas query at this step.
  • Literals and comparisons — Numbers, quoted strings, and comparison operators.
  • Boolean composition — Conditions combined with and, or, and parentheses.

The expression sees the current frame

A filter never reaches back to source columns. Rename or cast first, and the expression sees only those resulting names and values.

Filter expression turns rows into boolean decisions Thirty current rows are evaluated against amount greater than 50 and six true rows continue. 30 current rowsafter cast amount > 50boolean predicate 6 rowstrue only False rows stop here; every column on true rows continues.
A filter changes membership, not the column contract.

Run the complete example

Copy this manifest from the verified documentation project, then run it from the repository root.

version: "1.0"
transformations:
  steps:
    - cast:
        mapping:
          amount: float
    - filter:
        expr: "amount > 50"
hdrctl run examples/tutorial/dsl-elements
  ✅ Pipeline completed successfully in 2.6s
  Rows read   : 30
  Rows written: 6

The relevant command syntax, copied from hdrctl run --help:

hdrctl run [PATH]
  -s, --sources FILE          explicit path to sources.yaml
  -d, --destinations FILE     explicit path to destinations.yaml
  -t, --transformations FILE  explicit path to transformations.yaml
  -P, --param KEY=VALUE       override a parameter, repeatable

Close by

0 / 0 on this page