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

Method _simplify_down

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

Source from the content-addressed store, hash-verified

2010 return other.operands + self.operands[1:]
2011
2012 def _simplify_down(self):
2013 if isinstance(self.frame, Assign):
2014 if self._check_for_previously_created_column(self.frame):
2015 # don't squash if we are using a column that was previously created
2016 return
2017 return Assign(*self._remove_common_columns(self.frame))
2018 elif isinstance(self.frame, Projection) and isinstance(
2019 self.frame.frame, Assign
2020 ):
2021 if self._check_for_previously_created_column(self.frame.frame):
2022 return
2023 new_columns = self.frame.operands[1].copy()
2024 new_columns.extend([k for k in self.keys if k not in new_columns])
2025 return Projection(
2026 Assign(*self._remove_common_columns(self.frame.frame)), new_columns
2027 )
2028
2029 def _check_for_previously_created_column(self, child):
2030 input_columns = []

Callers

nothing calls this directly

Calls 5

AssignClass · 0.85
ProjectionClass · 0.85
copyMethod · 0.45

Tested by

no test coverage detected