Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed May 6, 2024
1 parent ea05389 commit 005f480
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modin/core/dataframe/pandas/dataframe/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@ def astype_builder(df):
# Assume that the dtype is a scalar.
if not (col_dtypes == self_dtypes).all():
new_dtypes = self_dtypes.copy()
new_dtype = self.construct_dtype(col_dtypes)
new_dtype = self.construct_dtype(col_dtypes, self._pandas_backend)
if Engine.get() == "Dask" and hasattr(new_dtype, "_is_materialized"):
# FIXME: https://github.com/dask/distributed/issues/8585
_ = new_dtype._materialize_categories()
Expand Down Expand Up @@ -4525,7 +4525,7 @@ def from_pandas(cls, df):
new_index = df.index
new_columns = df.columns
new_dtypes = df.dtypes
new_frame, new_lengths, new_widths, backend = (
new_frame, new_lengths, new_widths, pandas_backend = (
cls._partition_mgr_cls.from_pandas(df, True)
)
return cls(
Expand All @@ -4535,7 +4535,7 @@ def from_pandas(cls, df):
new_lengths,
new_widths,
dtypes=new_dtypes,
backend=backend,
pandas_backend=pandas_backend,
)

@classmethod
Expand All @@ -4553,8 +4553,8 @@ def from_arrow(cls, at):
PandasDataframe
New Modin DataFrame.
"""
new_frame, new_lengths, new_widths, backend = cls._partition_mgr_cls.from_arrow(
at, return_dims=True
new_frame, new_lengths, new_widths, pandas_backend = (

Check warning on line 4556 in modin/core/dataframe/pandas/dataframe/dataframe.py

View check run for this annotation

Codecov / codecov/patch

modin/core/dataframe/pandas/dataframe/dataframe.py#L4556

Added line #L4556 was not covered by tests
cls._partition_mgr_cls.from_arrow(at, return_dims=True)
)
new_columns = Index.__new__(Index, data=at.column_names, dtype="O")
new_index = Index.__new__(RangeIndex, data=range(at.num_rows))
Expand All @@ -4569,7 +4569,7 @@ def from_arrow(cls, at):
row_lengths=new_lengths,
column_widths=new_widths,
dtypes=new_dtypes,
backend=backend,
pandas_backend=pandas_backend,
)

@classmethod
Expand Down

0 comments on commit 005f480

Please sign in to comment.