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
Parameters
Return type
Return type
None
Name Type Default Info node int
The UID of the node to have the operator committed to. op_type str
The operator type to be committed, e.g., TruncatePreprocessor. op_config Optional[Dict[str, Any]]
None
The operator config, e.g., {“field”: “text”, “by”: “chars”, “length”: 5}. Use get_default_operator()
to check required fields for built-in operators.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},
>>> )