| 3574 | |
| 3575 | |
| 3576 | class CombineFirstAlign(MaybeAlignPartitions): |
| 3577 | _parameters = ["frame", "other"] |
| 3578 | _expr_cls = CombineFirst |
| 3579 | |
| 3580 | def _simplify_up(self, parent, dependents): |
| 3581 | # TODO: de-duplicate |
| 3582 | if isinstance(parent, Projection): |
| 3583 | columns = determine_column_projection(self, parent, dependents) |
| 3584 | frame_columns = [col for col in self.frame.columns if col in columns] |
| 3585 | other_columns = [col for col in self.other.columns if col in columns] |
| 3586 | if ( |
| 3587 | self.frame.columns == frame_columns |
| 3588 | and self.other.columns == other_columns |
| 3589 | ): |
| 3590 | return |
| 3591 | |
| 3592 | return type(parent)( |
| 3593 | type(self)(self.frame[frame_columns], self.other[other_columns]), |
| 3594 | *parent.operands[1:], |
| 3595 | ) |
| 3596 | |
| 3597 | |
| 3598 | class FillnaAlign(MaybeAlignPartitions): |