| 2570 | raise NotImplementedError() |
| 2571 | |
| 2572 | def _simplify_down(self): |
| 2573 | if isinstance(self.frame, Elemwise): |
| 2574 | operands = [ |
| 2575 | ( |
| 2576 | Head(op, self.n, self.operand("npartitions")) |
| 2577 | if isinstance(op, Expr) and not isinstance(op, _DelayedExpr) |
| 2578 | else op |
| 2579 | ) |
| 2580 | for op in self.frame.operands |
| 2581 | ] |
| 2582 | return type(self.frame)(*operands) |
| 2583 | if isinstance(self.frame, Head): |
| 2584 | return Head( |
| 2585 | self.frame.frame, min(self.n, self.frame.n), self.operand("npartitions") |
| 2586 | ) |
| 2587 | |
| 2588 | def _simplify_up(self, parent, dependents): |
| 2589 | from dask.dataframe.dask_expr import Repartition |