Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PERF-#5087: use cache for widths/lengths/index/columns if possible #5031

Merged
merged 3 commits into from
Oct 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions modin/core/dataframe/pandas/dataframe/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,10 +1172,10 @@ def astype_builder(df):
)
return self.__constructor__(
new_frame,
self.index,
self.columns,
self.row_lengths,
self.column_widths,
self._index_cache,
self._columns_cache,
self._row_lengths_cache,
self._column_widths_cache,
new_dtypes,
)

Expand Down Expand Up @@ -1689,8 +1689,8 @@ def map(self, func: Callable, dtypes: Optional[str] = None) -> "PandasDataframe"
)
return self.__constructor__(
new_partitions,
self.axes[0],
self.axes[1],
self._index_cache,
self._columns_cache,
self._row_lengths_cache,
self._column_widths_cache,
dtypes=dtypes,
Expand Down Expand Up @@ -1757,10 +1757,10 @@ def fold(self, axis, func):
)
return self.__constructor__(
new_partitions,
self.index,
self.columns,
self.row_lengths,
self.column_widths,
self._index_cache,
self._columns_cache,
self._row_lengths_cache,
self._column_widths_cache,
YarShev marked this conversation as resolved.
Show resolved Hide resolved
)

def infer_objects(self) -> "PandasDataframe":
Expand Down Expand Up @@ -1802,10 +1802,10 @@ def infer_types(self, col_labels: List[str]) -> "PandasDataframe":
new_dtypes[col_labels] = new_cols_dtypes
return self.__constructor__(
self._partitions,
self.index,
self.columns,
self.row_lengths,
self.column_widths,
self._index_cache,
self._columns_cache,
self._row_lengths_cache,
self._column_widths_cache,
new_dtypes,
)

Expand Down Expand Up @@ -1910,8 +1910,8 @@ def map_fn(df):
new_parts,
new_index,
new_cols,
self.row_lengths,
self.column_widths,
self._row_lengths_cache,
self._column_widths_cache,
new_dtypes,
)

Expand Down Expand Up @@ -3105,10 +3105,10 @@ def transpose(self):
new_dtypes = None
return self.__constructor__(
new_partitions,
self.columns,
self.index,
self.column_widths,
self.row_lengths,
self._columns_cache,
self._index_cache,
self._column_widths_cache,
self._row_lengths_cache,
dtypes=new_dtypes,
)

Expand Down