From ec0efa7be30d95187a7798dce8afe47255e53558 Mon Sep 17 00:00:00 2001 From: Lozovskii-Aleksandr <86873279+Lozovskii-Aleksandr@users.noreply.github.com> Date: Tue, 14 Dec 2021 23:28:34 +0300 Subject: [PATCH] FIX-#3741: Added delivery of the data argument to DataFrame constructor (#3742) Signed-off-by: aleksandr.lozovskii --- .github/workflows/ci.yml | 1 + modin/experimental/cloud/rpyc_proxy.py | 28 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85cbe64b76a..3b4c3dca1f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -549,6 +549,7 @@ jobs: conda info conda list - run: python -m pytest --simulate-cloud=normal modin/pandas/test/test_io.py --verbose + - run: python -m pytest --simulate-cloud=normal modin/pandas/test/dataframe/test_default.py::test_kurt_kurtosis --verbose - # When running without parameters, some of the tests fail run: python -m pytest --simulate-cloud=normal modin/pandas/test/dataframe/test_binary.py::test_math_functions[add-rows-scalar] - run: | diff --git a/modin/experimental/cloud/rpyc_proxy.py b/modin/experimental/cloud/rpyc_proxy.py index c9b524138e6..e18ecf75e62 100644 --- a/modin/experimental/cloud/rpyc_proxy.py +++ b/modin/experimental/cloud/rpyc_proxy.py @@ -428,6 +428,13 @@ class Wrapper(override, origin_cls, metaclass=ProxyMeta): def __init__(self, *a, __remote_end__=None, **kw): if __remote_end__ is None: + try: + preprocess = object.__getattribute__(self, "_preprocess_init_args") + except AttributeError: + pass + else: + a, kw = preprocess(*a, **kw) + __remote_end__ = remote_cls(*a, **kw) while True: # unwrap the object if it's a wrapper @@ -622,6 +629,27 @@ def iteritems(self): ObtainingItems = _deliveringWrapper(Series, mixin=ObtainingItems) class DataFrameOverrides(_prepare_loc_mixin()): + @classmethod + def _preprocess_init_args( + cls, + data=None, + index=None, + columns=None, + dtype=None, + copy=None, + query_compiler=None, + ): + + (data,) = conn.deliver((data,), {})[0] + return (), dict( + data=data, + index=index, + columns=columns, + dtype=dtype, + copy=copy, + query_compiler=query_compiler, + ) + @property def dtypes(self): remote_dtypes = self.__remote_end__.dtypes