Skip to main content

Function: filter()

filter<T>(stream, predicate): Stream<T>

Defined in: packages/core/src/graph/transforms.ts:107

Drop rows that don't match the predicate.

const cleaned = filter(rowStream, (r) => r.valid); // Stream

Passing rows propagate unchanged. Failing rows cause the filter node to emit a dropped outcome with {kind: 'filtered_out', droppedAt}; every descendant cascades with the same reason. Implemented by throwing FilterDroppedRowError — the graph runner has a dedicated catch arm that turns this into a skip (not an error) so descendants see filtered_out rather than upstream_failed.

Type Parameters

T

T

Parameters

stream

Stream<T>

predicate

(row) => boolean

Returns

Stream<T>