Skip to content

Commit

Permalink
FIX-#3725: do not trigger computation of lazy 'dtypes' on transpose (#…
Browse files Browse the repository at this point in the history
…3748)

Signed-off-by: Dmitry Chigarev <dmitry.chigarev@intel.com>
  • Loading branch information
dchigarev authored Dec 3, 2021
1 parent e9c06f2 commit cd8db0c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modin/core/dataframe/pandas/dataframe/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2300,10 +2300,13 @@ def transpose(self):
new_partitions = self._partition_mgr_cls.lazy_map_partitions(
self._partitions, lambda df: df.T
).T
new_dtypes = pandas.Series(
np.full(len(self.index), find_common_type(self.dtypes.values)),
index=self.index,
)
if self._dtypes is not None:
new_dtypes = pandas.Series(
np.full(len(self.index), find_common_type(self.dtypes.values)),
index=self.index,
)
else:
new_dtypes = None
return self.__constructor__(
new_partitions,
self.columns,
Expand Down

0 comments on commit cd8db0c

Please sign in to comment.