Is your feature request related to a problem or challenge? Please describe what you are trying to do.
DataFusion Python currently provides execution metrics only through the explain(analyze=True) output, which displays metrics as formatted console text. There is no structured Python API to programmatically access per-operator metrics such as output_rows, elapsed_compute, spill_count, etc.
Describe the solution you'd like
Expose a structured Python API to access execution metrics after running a query
Describe alternatives you've considered
N/A
Additional context
This mirrors the existing Rust API in datafusion::physical_plan::metrics and makes it accessible from Python. The metrics would only be populated after execution, matching DataFusion's semantics where metrics are collected during query execution.
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
DataFusion Python currently provides execution metrics only through the
explain(analyze=True)output, which displays metrics as formatted console text. There is no structured Python API to programmatically access per-operator metrics such asoutput_rows,elapsed_compute,spill_count, etc.Describe the solution you'd like
Expose a structured Python API to access execution metrics after running a query
Describe alternatives you've considered
N/A
Additional context
This mirrors the existing Rust API in datafusion::physical_plan::metrics and makes it accessible from Python. The metrics would only be populated after execution, matching DataFusion's semantics where metrics are collected during query execution.