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 ParsedQuery into an existing graph builder g.

This is the low-level companion to sql_to_onnx_graph() for callers that have already obtained a ParsedQuery produced by trace_dataframe(). All type information is read from the dtype fields that the tracer populates; no input_dtypes argument 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 all ColumnRef objects carry a non-zero dtype.

  • _finalize – when True (default) the SELECT output tensors are registered as ONNX model outputs via make_tensor_output(). Pass False when 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.