gather¶
- pydantic model Gather[source]¶
Cardinality reduction.
Given a node that emits >1 events, gather them into a single iterable.
Two (mutually exclusive) modes:
gather a fixed number of events
nodename: type: gather params: n: 5 depends: - value: othernode.signal
gather events until a trigger is received
nodename: type: gather depends: - value: othernode.signal_1 - trigger: thirdnode.signal_2
- Config:
extra: str = forbid
- Fields:
- field flatten: bool = False¶
If an individual gathered value is a sequence (and thus the returned gathered value a sequence of sequences), flatten the sequences by 1 level.
[[‘a’, ‘b’], [‘c’], []] -> [‘a’, ‘b’, ‘c’]