Skip to main content

group()

Several nodes to refresh together, against the same source versions:

Usage

Source

group(*nodes)

sv.group(a, b).refresh(). A stored node they share is refreshed and written once; .status() reports on each.

Parameters

*nodes: Node
The nodes to refresh together: results of transforms, stored or not (not sources).

Returns

Group
A Group, with refresh and status.

Raises

TypeError
No nodes are given, or one is not a node (a source, or an Ibis table).

Examples

Two outputs that read the same stored node, with p and r from the Node example:

@sv.transform()
def customers(t):
    return t.select(t.customer)

g = sv.group(r, p.pipe(customers))  # fan-out: p is piped twice
result = g.refresh()  # paid is refreshed and written once
[s.node for s in result.nodes]  # ['paid', 'doubled', 'customers']
print(g.status())  # one line per node