polars_nanook.LazyFrameRemote.show_graph#

LazyFrameRemote.show_graph(
*,
plan_stage: PlanType = 'physical',
optimizations: QueryOptFlags = <polars.lazyframe.opt_flags.QueryOptFlags object>,
show: bool = True,
output_path: str | Path | None = None,
raw_output: bool = False,
figsize: tuple[float,
float] = (16.0,
12.0),
silent: bool | None = None,
) → str | None#

Plan the query on the compute cluster and show the plan as a graph.

The query is sent to the cluster and planned there, but no data is read and no output is written. Rendering the graph requires the graphviz dot binary, unless raw_output is set.

Note

This can only be called in ‘direct’ mode.

Parameters:
plan_stage{‘physical’, ‘ir’}

Which plan to show.

  • physical: The distributed physical plan/stages.

  • ir: The optimized query plan. Stops before distributed planning, so no physical plan is built.

optimizations

The optimization passes done during query optimization.

show

Show the figure.

output_path

Write the figure to disk.

raw_output

Return dot syntax. This cannot be combined with show and/or output_path.

figsize

Passed to matplotlib if show == True.

silent

Don’t print to stdout while waiting for the plan.

Examples

>>> query.remote(ctx).show_graph()  
>>> query.remote(ctx).show_graph(plan_stage="ir")