map | filter | process | delay | flat_map | flat_map_iterable | key_byMap, Filter, Process, Delay, and expansion
Single-input operators that transform, select, execute, delay, expand, or key messages.
When to use
Choose the narrowest method that represents the callback contract and output shape.
Behavior
- Methods requiring user code accept a Function object.
flat_map_iterableexpands an iterable without a user Function.key_byrequires key_type because it changes the keyed stream contract.delayrequires duration and a Function because runtime-specific delay behavior may be generated.
Map and Filter properties
Common transformation operators.
map(name, *, function, value_type=None, source=None, x=0, y=0)StreamTransform one input and optionally change its value contract.
filter(name, *, function, source=None, x=0, y=0)StreamRetain messages accepted by the callback.
Process and Delay properties
Execution and time control.
process(..., pattern=None, value_type=None, error_stream=None)StreamExecute or collect according to ProcessPattern.
delay(..., function, duration, source=None)StreamDelay processing by duration milliseconds.
Expansion and keying properties
Cardinality and keyed contracts.
flat_map(..., function, value_type=None)StreamEmit zero or more callback results.
flat_map_iterable(..., value_type=None)StreamExpand an iterable value.
key_by(..., function, key_type, value_type=None)StreamDerive a key while retaining or selecting the value contract.
Common parameters properties
Shared by these factory methods.
namestrHuman-readable stream name; the symbolic key is derived automatically.
RequiredsourceStream | NoneOptional primary upstream stream.
Default:Nonex / yfloatDesigner canvas coordinates.
Default:0 / 0functionFunctionBusiness callback metadata used to generate the implementation contract.
Requiredvalue_typeTypeDefinition | DataType | str | NoneOutput or boundary payload contract.
Default:NonePython example
validate = orders.filter("Valid Orders", function=validate_order)
enrich = orders.map(
"Enrich Order", function=enrich_order, value_type=enriched_order
)
keyed = orders.key_by(
"Key By Customer", function=customer_key, key_type=customer_id
)
validate >> enrich >> keyed