From 005f4802c3520e8c1be6c5c5e95a048aa186ec1a Mon Sep 17 00:00:00 2001 From: Anatoly Myachev Date: Mon, 6 May 2024 16:02:00 +0200 Subject: [PATCH] fix Signed-off-by: Anatoly Myachev --- modin/core/dataframe/pandas/dataframe/dataframe.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modin/core/dataframe/pandas/dataframe/dataframe.py b/modin/core/dataframe/pandas/dataframe/dataframe.py index 0d2e9170eeb..6a32741b3cb 100644 --- a/modin/core/dataframe/pandas/dataframe/dataframe.py +++ b/modin/core/dataframe/pandas/dataframe/dataframe.py @@ -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() @@ -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( @@ -4535,7 +4535,7 @@ def from_pandas(cls, df): new_lengths, new_widths, dtypes=new_dtypes, - backend=backend, + pandas_backend=pandas_backend, ) @classmethod @@ -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 = ( + 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)) @@ -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