(self, other, axis="columns", level=None, fill_value=None)
| 202 | if class_ == DataFrame: |
| 203 | |
| 204 | def method(self, other, axis="columns", level=None, fill_value=None): |
| 205 | if level is not None: |
| 206 | raise NotImplementedError("level must be None") |
| 207 | |
| 208 | axis = _validate_axis(axis) |
| 209 | |
| 210 | if ( |
| 211 | is_dataframe_like(other) |
| 212 | or is_series_like(other) |
| 213 | and axis in (0, "index") |
| 214 | ) and not is_dask_collection(other): |
| 215 | other = self._create_alignable_frame(other) |
| 216 | |
| 217 | if axis in (1, "columns"): |
| 218 | if isinstance(other, Series): |
| 219 | msg = f"Unable to {name} dd.Series with axis=1" |
| 220 | raise ValueError(msg) |
| 221 | |
| 222 | frame = self |
| 223 | if isinstance(other, FrameBase) and not expr.are_co_aligned( |
| 224 | self.expr, other.expr |
| 225 | ): |
| 226 | return new_collection( |
| 227 | expr.MethodOperatorAlign( |
| 228 | op=name, |
| 229 | frame=frame, |
| 230 | other=other, |
| 231 | axis=axis, |
| 232 | level=level, |
| 233 | fill_value=fill_value, |
| 234 | ) |
| 235 | ) |
| 236 | |
| 237 | return new_collection( |
| 238 | expr.MethodOperator( |
| 239 | name=name, |
| 240 | left=frame, |
| 241 | right=other, |
| 242 | axis=axis, |
| 243 | level=level, |
| 244 | fill_value=fill_value, |
| 245 | ) |
| 246 | ) |
| 247 | |
| 248 | elif class_ == Series: |
| 249 |
no test coverage detected
searching dependent graphs…