Skip to content

Commit

Permalink
FEAT-modin-project#2627: fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev committed Aug 24, 2021
1 parent 1919329 commit 9f0c03c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions modin/engines/base/io/pickle/pickle_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _read(cls, filepath_or_buffer, **kwargs):
filepath_or_buffer,
**kwargs,
)
filepath_or_buffer = glob.glob(filepath_or_buffer)
filepath_or_buffer = sorted(glob.glob(filepath_or_buffer))

if len(filepath_or_buffer) == 0:
raise ValueError(
Expand All @@ -52,7 +52,7 @@ def _read(cls, filepath_or_buffer, **kwargs):
cls.parse,
3,
dict(
filepath=file_name,
fname=file_name,
**kwargs,
),
)
Expand All @@ -66,10 +66,10 @@ def _read(cls, filepath_or_buffer, **kwargs):
# while num_splits is 1, need only one value
partition_ids = cls.build_partition(partition_ids, lengths, [widths[0]])

new_index = cls.frame_cls._frame_mgr_cls.get_indices(
new_index = cls.frame_cls._partition_mgr_cls.get_indices(
0, partition_ids, lambda df: df.axes[0]
)
new_columns = cls.frame_cls._frame_mgr_cls.get_indices(
new_columns = cls.frame_cls._partition_mgr_cls.get_indices(
1, partition_ids, lambda df: df.axes[1]
)

Expand Down
4 changes: 1 addition & 3 deletions modin/experimental/engines/pandas_on_ray/io_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ def to_pickle_distributed(cls, qc, **kwargs):

def func(df, **kw):
idx = str(kw["partition_idx"])
kwargs["filepath_or_buffer"] = kwargs["filepath_or_buffer"].replace(
"*", idx
)
kwargs["path"] = kwargs.pop("filepath_or_buffer").replace("*", idx)
df.to_pickle(**kwargs)
return pandas.DataFrame()

Expand Down
2 changes: 1 addition & 1 deletion modin/experimental/pandas/io_exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def to_pickle_distributed(
Parameters
----------
filepath_or_buffer : str
filepath_or_buffer : str, path object or file-like object
File path where the pickled object will be stored.
compression : {{'infer', 'gzip', 'bz2', 'zip', 'xz', None}}, default: 'infer'
A string representing the compression to use in the output file. By
Expand Down

0 comments on commit 9f0c03c

Please sign in to comment.