diff --git a/modin/tests/pandas/native_df_mode/utils.py b/modin/tests/pandas/native_df_mode/utils.py index 247a1ea61fa..ea184fdecda 100644 --- a/modin/tests/pandas/native_df_mode/utils.py +++ b/modin/tests/pandas/native_df_mode/utils.py @@ -26,7 +26,7 @@ def create_test_df_in_defined_mode( ): with context(NativeDataframeMode=df_mode): return create_test_dfs( - *args, post_fn=None, backend=None, df_mode=None, **kwargs + *args, post_fn=post_fn, backend=backend, **kwargs ) @@ -34,7 +34,7 @@ def create_test_series_in_defined_mode( vals, sort=False, backend=None, df_mode=None, **kwargs ): with context(NativeDataframeMode=df_mode): - return create_test_series(vals, sort=False, backend=None, **kwargs) + return create_test_series(vals, sort=sort, backend=backend, **kwargs) def eval_general_interop( diff --git a/modin/tests/pandas/utils.py b/modin/tests/pandas/utils.py index d50baf6365c..16f5a87c0cc 100644 --- a/modin/tests/pandas/utils.py +++ b/modin/tests/pandas/utils.py @@ -43,7 +43,6 @@ Engine, MinColumnPartitionSize, MinRowPartitionSize, - NativeDataframeMode, NPartitions, RangePartitioning, TestDatasetSize, @@ -1088,11 +1087,7 @@ def eval_io_from_str(csv_str: str, unique_filename: str, **kwargs): def create_test_dfs( - *args, - post_fn=None, - backend=None, - df_mode=None, - **kwargs, + *args, post_fn=None, backend=None, **kwargs ) -> tuple[pd.DataFrame, pandas.DataFrame]: if post_fn is None: post_fn = lambda df: ( # noqa: E731 @@ -1102,24 +1097,14 @@ def create_test_dfs( post_fn = lambda df: post_fn(df).convert_dtypes( # noqa: E731 dtype_backend=backend ) - if df_mode: - actual_df_mode = NativeDataframeMode().get() - NativeDataframeMode().put(df_mode) - test_dfs = tuple( + return tuple( map(post_fn, [pd.DataFrame(*args, **kwargs), pandas.DataFrame(*args, **kwargs)]) ) - if df_mode: - NativeDataframeMode().put(actual_df_mode) - - return test_dfs def create_test_series( - vals, sort=False, backend=None, df_mode=None, **kwargs + vals, sort=False, backend=None, **kwargs ) -> tuple[pd.Series, pandas.Series]: - if df_mode: - actual_df_mode = NativeDataframeMode().get() - NativeDataframeMode().put(df_mode) if isinstance(vals, dict): modin_series = pd.Series(vals[next(iter(vals.keys()))], **kwargs) pandas_series = pandas.Series(vals[next(iter(vals.keys()))], **kwargs) @@ -1133,8 +1118,6 @@ def create_test_series( if backend is not None: modin_series = modin_series.convert_dtypes(dtype_backend=backend) pandas_series = pandas_series.convert_dtypes(dtype_backend=backend) - if df_mode: - NativeDataframeMode().put(actual_df_mode) return modin_series, pandas_series