Skip to main content
Version: 0.96

snorkelflow.client.nodes.commit_builtin_operator

snorkelflow.client.nodes.commit_builtin_operator(node, op_type, op_config=None)

Commit a built-in operator to the node

Parameters

NameTypeDefaultInfo
nodeintThe UID of the node to have the operator committed to.
op_typestrThe operator type to be committed, e.g., TruncatePreprocessor.
op_configOptional[Dict[str, Any]]NoneThe operator config, e.g., {“field”: “text”, “by”: “chars”, “length”: 5}. Use get_default_operator() to check required fields for built-in operators.

Return type

None

Examples

>>> new_node_id = sf.add_node(APP_NAME, input_node_uids=[123], output_node_uid=456)['node_uid']
>>> sf.commit_builtin_operator(
>>> new_node_id,
>>> op_type="TruncatePreprocessor",
>>> op_config={"field": "text", "by": "chars", "length": 5},
>>> )