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

Method optimize

dask/dataframe/dask_expr/_collection.py:560–578  ·  view source on GitHub ↗

Optimizes the DataFrame. Runs the optimizer with all steps over the DataFrame and wraps the result in a new DataFrame collection. Only use this method if you want to analyze the optimized expression. Parameters ---------- fuse: bool, default True

(self, fuse: bool = True)

Source from the content-addressed store, hash-verified

558 return new_collection(self.expr.lower_once({}))
559
560 def optimize(self, fuse: bool = True):
561 """Optimizes the DataFrame.
562
563 Runs the optimizer with all steps over the DataFrame and wraps the result in a
564 new DataFrame collection. Only use this method if you want to analyze the
565 optimized expression.
566
567 Parameters
568 ----------
569 fuse: bool, default True
570 Whether to fuse the expression tree after running the optimizer.
571 It is often easier to look at the non-fused expression when analyzing
572 the result.
573
574 Returns
575 -------
576 The optimized Dask Dataframe
577 """
578 return new_collection(self.expr.optimize(fuse=fuse))
579
580 def __dask_postcompute__(self):
581 state = new_collection(self.expr.lower_completely())

Callers 6

persistMethod · 0.95
to_delayedMethod · 0.95
iterrowsMethod · 0.45
itertuplesMethod · 0.45
__iter__Method · 0.45
optimizeFunction · 0.45

Calls 1

new_collectionFunction · 0.90

Tested by

no test coverage detected