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