MCPcopy Create free account
hub / github.com/dask/dask / explain

Method explain

dask/dataframe/dask_expr/_collection.py:489–523  ·  view source on GitHub ↗

Create a graph representation of the Expression. explain runs the optimizer and creates a graph of the optimized expression with graphviz. No computation is triggered. Parameters ---------- stage: {"logical", "simplified-logical", "tuned-logical", "physical"

(self, stage: OptimizerStage = "fused", format: str | None = None)

Source from the content-addressed store, hash-verified

487 return out.expr.analyze(filename=filename, format=format)
488
489 def explain(self, stage: OptimizerStage = "fused", format: str | None = None):
490 """Create a graph representation of the Expression.
491
492 explain runs the optimizer and creates a graph of the optimized expression
493 with graphviz. No computation is triggered.
494
495 Parameters
496 ----------
497 stage: {"logical", "simplified-logical", "tuned-logical", "physical", "simplified-physical", "fused"}
498 The optimizer stage that is returned. Default is "fused".
499
500 - logical: outputs the expression as is
501 - simplified-logical: simplifies the expression which includes predicate
502 pushdown and column projection.
503 - tuned-logical: applies additional optimizations like partition squashing
504 - physical: outputs the physical expression; this expression can actually
505 be computed
506 - simplified-physical: runs another simplification after the physical
507 plan is generated
508 - fused: fuses the physical expression to reduce the nodes in thr graph.
509
510 .. warning::
511 The optimizer stages are subject to change.
512 format: str, default None
513 The format of the output. Default is "png".
514
515 Returns
516 -------
517 None, but opens a new window with the graph visualization and outputs
518 a file with the graph representation.
519 """
520 out = self
521 if not isinstance(out, Scalar):
522 out = out.repartition(npartitions=1)
523 return out.expr.explain(stage, format)
524
525 def pprint(self):
526 """Outputs a string representation of the DataFrame.

Callers

nothing calls this directly

Calls 1

repartitionMethod · 0.45

Tested by

no test coverage detected