yobx.sql.parsed_query_to_onnx_graph#
- yobx.sql.parsed_query_to_onnx_graph(g: GraphBuilderExtendedProtocol, sts: Dict | None, outputs: List[str] | None, pq: ParsedQuery, _finalize: bool = True) List[str][source]#
Build ONNX nodes for an already-parsed
ParsedQueryinto an existing graph builder g.This is the low-level companion to
sql_to_onnx_graph()for callers that have already obtained aParsedQueryproduced bytrace_dataframe(). All type information is read from thedtypefields that the tracer populates; noinput_dtypesargument is needed.- Parameters:
g – an existing graph builder.
sts – context dictionary; may contain a
"custom_functions"key.outputs – expected output column names (may be empty).
pq – the parsed query to convert. Must have been produced by
trace_dataframe()so that allColumnRefobjects carry a non-zerodtype._finalize – when
True(default) the SELECT output tensors are registered as ONNX model outputs viamake_tensor_output(). PassFalsewhen embedding the conversion in an outer graph (e.g. inside an sklearn converter) so that the caller can register the outputs itself.
- Returns:
list of output tensor names added to g.