(self)
| 3723 | return getattr(self.frame._meta, self.op)(self.other._meta) |
| 3724 | |
| 3725 | def _lower(self): |
| 3726 | # This can be expensive when something that has expensive division |
| 3727 | # calculation is in the Expression |
| 3728 | dfs = self.args |
| 3729 | if ( |
| 3730 | len(dfs) == 1 |
| 3731 | or all(dfs[0].divisions == df.divisions for df in dfs) |
| 3732 | or len(self.divisions) == 2 |
| 3733 | and max(map(lambda x: len(x.divisions), dfs)) == 2 |
| 3734 | ): |
| 3735 | return self._op(self.frame, self.op, self.other, *self.operands[3:]) |
| 3736 | |
| 3737 | from dask.dataframe.dask_expr._repartition import RepartitionDivisions |
| 3738 | |
| 3739 | frame = RepartitionDivisions( |
| 3740 | self.frame, new_divisions=self.divisions, force=True |
| 3741 | ) |
| 3742 | other = RepartitionDivisions( |
| 3743 | self.other, new_divisions=self.divisions, force=True |
| 3744 | ) |
| 3745 | return self._op(frame, self.op, other, *self.operands[3:]) |
| 3746 | |
| 3747 | @staticmethod |
| 3748 | def _op(frame, op, other, *args, **kwargs): |
nothing calls this directly
no test coverage detected