MCPcopy Index your code
hub / github.com/dask/dask / _simplify_down

Method _simplify_down

dask/dataframe/dask_expr/_expr.py:2028–2043  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2026 return other.operands + self.operands[1:]
2027
2028 def _simplify_down(self):
2029 if isinstance(self.frame, Assign):
2030 if self._check_for_previously_created_column(self.frame):
2031 # don't squash if we are using a column that was previously created
2032 return
2033 return Assign(*self._remove_common_columns(self.frame))
2034 elif isinstance(self.frame, Projection) and isinstance(
2035 self.frame.frame, Assign
2036 ):
2037 if self._check_for_previously_created_column(self.frame.frame):
2038 return
2039 new_columns = self.frame.operands[1].copy()
2040 new_columns.extend([k for k in self.keys if k not in new_columns])
2041 return Projection(
2042 Assign(*self._remove_common_columns(self.frame.frame)), new_columns
2043 )
2044
2045 def _check_for_previously_created_column(self, child):
2046 input_columns = []

Callers

nothing calls this directly

Calls 5

AssignClass · 0.85
ProjectionClass · 0.85
copyMethod · 0.45

Tested by

no test coverage detected