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

Method _simplify_down

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

AssignClass · 0.85
ProjectionClass · 0.85
copyMethod · 0.45

Tested by

no test coverage detected