Skip to content

Commit

Permalink
REFACTOR-modin-project#3780: remove '_row_lengths', '_column_widths' …
Browse files Browse the repository at this point in the history
…funcs in 'PandasOnDaskDataframe'

Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed Feb 21, 2022
1 parent dd9beee commit 080eb2f
Showing 1 changed file with 0 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
from modin.core.dataframe.pandas.dataframe.dataframe import PandasDataframe
from ..partitioning.partition_manager import PandasOnDaskDataframePartitionManager

from distributed.client import default_client


class PandasOnDaskDataframe(PandasDataframe):
"""
Expand All @@ -42,40 +40,3 @@ class PandasOnDaskDataframe(PandasDataframe):
"""

_partition_mgr_cls = PandasOnDaskDataframePartitionManager

@property
def _row_lengths(self):
"""
Compute the row partitions lengths if they are not cached.
Returns
-------
list
A list of row partitions lengths.
"""
client = default_client()
if self._row_lengths_cache is None:
self._row_lengths_cache = client.gather(
[obj.apply(lambda df: len(df)).future for obj in self._partitions.T[0]]
)
return self._row_lengths_cache

@property
def _column_widths(self):
"""
Compute the column partitions widths if they are not cached.
Returns
-------
list
A list of column partitions widths.
"""
client = default_client()
if self._column_widths_cache is None:
self._column_widths_cache = client.gather(
[
obj.apply(lambda df: len(df.columns)).future
for obj in self._partitions[0]
]
)
return self._column_widths_cache

0 comments on commit 080eb2f

Please sign in to comment.