MCPcopy Create free account
hub / github.com/dask/dask / _simplify_up

Method _simplify_up

dask/dataframe/dask_expr/_expr.py:2731–2758  ·  view source on GitHub ↗
(self, parent, dependents)

Source from the content-addressed store, hash-verified

2729 return f"{self.left} {self._operator_repr} {self.right}"
2730
2731 def _simplify_up(self, parent, dependents):
2732 if isinstance(parent, Projection):
2733 changed = False
2734 columns = determine_column_projection(self, parent, dependents)
2735 columns = _convert_to_list(columns)
2736 columns = [col for col in self.columns if col in columns]
2737 if (
2738 isinstance(self.left, Expr)
2739 and self.left.ndim > 1
2740 and self.left.columns != columns
2741 ):
2742 left = self.left[columns] # TODO: filter just the correct columns
2743 changed = True
2744 else:
2745 left = self.left
2746 if (
2747 isinstance(self.right, Expr)
2748 and self.right.ndim > 1
2749 and self.right.columns != columns
2750 ):
2751 right = self.right[columns] # TODO: filter just the correct columns
2752 changed = True
2753 else:
2754 right = self.right
2755 if not changed:
2756 return
2757
2758 return type(parent)(type(self)(left, right), *parent.operands[1:])
2759
2760 def _node_label_args(self):
2761 return [self.left, self.right]

Callers

nothing calls this directly

Calls 2

_convert_to_listFunction · 0.90

Tested by

no test coverage detected