Outputs statistics about every node in the expression. analyze optimizes the expression and triggers a computation. It records statistics like memory usage per partition to analyze how data flow through the graph. .. warning:: analyze adds plugins to the schedul
(
self, filename: str | None = None, format: str | None = None
)
| 499 | return DaskMethodsMixin.persist(out, **kwargs) |
| 500 | |
| 501 | def analyze( |
| 502 | self, filename: str | None = None, format: str | None = None |
| 503 | ) -> Digraph: |
| 504 | """Outputs statistics about every node in the expression. |
| 505 | |
| 506 | analyze optimizes the expression and triggers a computation. It records statistics |
| 507 | like memory usage per partition to analyze how data flow through the graph. |
| 508 | |
| 509 | .. warning:: |
| 510 | analyze adds plugins to the scheduler and the workers that have a non-trivial |
| 511 | cost. This method should not be used in production workflows. |
| 512 | |
| 513 | Parameters |
| 514 | ---------- |
| 515 | filename: str, None |
| 516 | File to store the graph representation. |
| 517 | format: str, default is png |
| 518 | File format for the graph representation. |
| 519 | |
| 520 | Returns |
| 521 | ------- |
| 522 | The graphviz.Digraph written to disk, enriched with expression statistics. |
| 523 | """ |
| 524 | out = self |
| 525 | if not isinstance(out, Scalar): |
| 526 | out = out.repartition(npartitions=1) |
| 527 | return out.expr.analyze(filename=filename, format=format) |
| 528 | |
| 529 | def explain(self, stage: OptimizerStage = "fused", format: str | None = None): |
| 530 | """Create a graph representation of the Expression. |