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

FEAT-#2606: Support creating DataFrame from remote partitions #2613

Merged
merged 7 commits into from
Jan 28, 2021
3 changes: 3 additions & 0 deletions modin/api/partition_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def create_df_from_partitions(partitions, axis):
partition_frame_class = factory.io_cls.frame_cls
partition_mgr_class = factory.io_cls.frame_cls._frame_mgr_cls

# When collecting partitions to NumPy array they will be kept row-wise
if axis is None:
if isinstance(partitions[0][0], tuple):
parts = np.array(
Expand All @@ -128,13 +129,15 @@ def create_df_from_partitions(partitions, axis):
for row in partitions
]
)
# When collecting partitions to NumPy array they will be kept row-wise
elif axis == 0:
if isinstance(partitions[0], tuple):
parts = np.array(
[[partition_class(partition, ip=ip)] for ip, partition in partitions]
)
else:
parts = np.array([[partition_class(partition)] for partition in partitions])
# When collecting partitions to NumPy array they will be kept column-wise
YarShev marked this conversation as resolved.
Show resolved Hide resolved
elif axis == 1:
if isinstance(partitions[0], tuple):
parts = np.array(
Expand Down