(self, other, op=None)
| 164 | |
| 165 | |
| 166 | def _wrap_expr_op(self, other, op=None): |
| 167 | # Wrap expr operator |
| 168 | assert op is not None |
| 169 | if isinstance(other, FrameBase): |
| 170 | other = other.expr |
| 171 | elif isinstance(other, da.Array): |
| 172 | other = from_dask_array(other, index=self.index, columns=self.columns) |
| 173 | if self.ndim == 1 and len(self.columns): |
| 174 | other = other[self.columns[0]] |
| 175 | |
| 176 | if ( |
| 177 | not isinstance(other, expr.Expr) |
| 178 | and is_dataframe_like(other) |
| 179 | or is_series_like(other) |
| 180 | ): |
| 181 | other = self._create_alignable_frame(other).expr |
| 182 | |
| 183 | if not isinstance(other, expr.Expr): |
| 184 | return new_collection(getattr(self.expr, op)(other)) |
| 185 | elif expr.are_co_aligned(self.expr, other): |
| 186 | return new_collection(getattr(self.expr, op)(other)) |
| 187 | else: |
| 188 | return new_collection(expr.OpAlignPartitions(self, other, op)) |
| 189 | |
| 190 | |
| 191 | def _wrap_expr_method_operator(name, class_): |
nothing calls this directly
no test coverage detected