internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: modin-project/modin

Issue:
`Series.sum` does not give the same error message as pandas on `numeric_only=True` 
Discovered as a part of #2847 


Discussion:

Resolving patch:
diff --git a/modin/pandas/series.py b/modin/pandas/series.py
--- a/modin/pandas/series.py
+++ b/modin/pandas/series.py
@@ -1249,6 +1249,8 @@ def sum(
         **kwargs,
     ):
         axis = self._get_axis_number(axis)
+        if numeric_only is True:
+            raise NotImplementedError("Series.sum does not implement numeric_only")
         if level is not None:
             if (
                 not self._query_compiler.has_multiindex(axis=axis)


Test patch:
diff --git a/modin/pandas/test/test_series.py b/modin/pandas/test/test_series.py
--- a/modin/pandas/test/test_series.py
+++ b/modin/pandas/test/test_series.py
@@ -3059,19 +3059,7 @@ def test_subtract(data):
 @pytest.mark.parametrize(
     "skipna", bool_arg_values, ids=arg_keys("skipna", bool_arg_keys)
 )
-@pytest.mark.parametrize(
-    "numeric_only",
-    [
-        None,
-        False,
-        pytest.param(
-            True,
-            marks=pytest.mark.xfail(
-                reason="numeric_only not implemented for pandas.Series"
-            ),
-        ),
-    ],
-)
+@pytest.mark.parametrize("numeric_only", [None, False, True])
 @pytest.mark.parametrize(
     "min_count", int_arg_values, ids=arg_keys("min_count", int_arg_keys)
 )
Repository: modin-project/modin

Issue:
Add 'dropna' support for OmniSci backend
This is required by #1294


Discussion:
Bug was found at the initial implementation: https://github.com/modin-project/modin/pull/2880#discussion_r595768146

Resolving patch:
diff --git a/modin/experimental/engines/omnisci_on_ray/frame/data.py b/modin/experimental/engines/omnisci_on_ray/frame/data.py
--- a/modin/experimental/engines/omnisci_on_ray/frame/data.py
+++ b/modin/experimental/engines/omnisci_on_ray/frame/data.py
@@ -466,6 +466,8 @@ def dropna(self, subset, how="any"):
         # based on "rowid". This is needed because 'dropna' preserves index.
         if self._index_cols is None:
             base = self._materialize_rowid()
+        else:
+            base = self
 
         checks = [base.ref(col).is_not_null() for col in subset]
         condition = (


Test patch:
diff --git a/modin/experimental/engines/omnisci_on_ray/test/test_dataframe.py b/modin/experimental/engines/omnisci_on_ray/test/test_dataframe.py
--- a/modin/experimental/engines/omnisci_on_ray/test/test_dataframe.py
+++ b/modin/experimental/engines/omnisci_on_ray/test/test_dataframe.py
@@ -1679,6 +1679,23 @@ def applier(df, *args, **kwargs):
 
         run_and_compare(applier, data=self.data)
 
+    def test_dropna_multiindex(self):
+        index = generate_multiindex(len(self.data["col1"]))
+
+        md_df = pd.DataFrame(self.data, index=index)
+        pd_df = pandas.DataFrame(self.data, index=index)
+
+        md_res = md_df.dropna()._to_pandas()
+        pd_res = pd_df.dropna()
+
+        # HACK: all strings in OmniSci considered to be categories, that breaks
+        # checks for equality with pandas, this line discards category dtype
+        md_res.index = pandas.MultiIndex.from_tuples(
+            md_res.index.values, names=md_res.index.names
+        )
+
+        df_equals(md_res, pd_res)
+
     @pytest.mark.skip("Dropna logic for GroupBy is disabled for now")
     @pytest.mark.parametrize("by", ["col1", ["col1", "col2"], ["col1", "col4"]])
     @pytest.mark.parametrize("dropna", [True, False])
Repository: modin-project/modin

Issue:
numpy==1.20.0 breaks "modin in the cloud"
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
- **Modin version** (`modin.__version__`):
- **Python version**:
- **Code we can use to reproduce**:
_To be filled a bit later_
<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

### Describe the problem
<!-- Describe the problem clearly here. -->

### Source code / logs
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->



Discussion:
A bit related to #2680 

Resolving patch:
diff --git a/modin/conftest.py b/modin/conftest.py
--- a/modin/conftest.py
+++ b/modin/conftest.py
@@ -135,6 +135,7 @@ def simulate_cloud(request):
         with Patcher(
             get_connection(),
             (pandas._testing, "assert_class_equal"),
+            (pandas._testing, "assert_series_equal"),
             (cyx_testing, "assert_almost_equal"),
         ):
             yield
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -60,7 +60,7 @@ def is_pure(self):
     url="https://github.com/modin-project/modin",
     long_description=long_description,
     long_description_content_type="text/markdown",
-    install_requires=["pandas==1.2.4", "packaging", "numpy>=1.16.5,<1.20"],
+    install_requires=["pandas==1.2.4", "packaging", "numpy>=1.16.5"],
     extras_require={
         # can be installed by pip install modin[dask]
         "dask": dask_deps,


Test patch:
Repository: modin-project/modin

Issue:
Implement true/false_values parameters for read_csv with OmniSci backend
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. What kind of performance improvements would you like to see with this new API?



Discussion:

Resolving patch:
diff --git a/modin/experimental/engines/omnisci_on_native/io.py b/modin/experimental/engines/omnisci_on_native/io.py
--- a/modin/experimental/engines/omnisci_on_native/io.py
+++ b/modin/experimental/engines/omnisci_on_native/io.py
@@ -129,8 +129,6 @@ class OmnisciOnNativeIO(BaseIO, TextFileDispatcher):
         "prefix",
         "converters",
         "skipfooter",
-        "true_values",
-        "false_values",
         "nrows",
         "skipinitialspace",
         "squeeze",
@@ -273,8 +271,13 @@ def read_csv(
                 check_utf8=None,
                 column_types=column_types,
                 null_values=None,
-                true_values=None,
-                false_values=None,
+                # we need to add default true/false_values like Pandas does
+                true_values=true_values + ["TRUE", "True", "true"]
+                if true_values is not None
+                else true_values,
+                false_values=false_values + ["False", "FALSE", "false"]
+                if false_values is not None
+                else false_values,
                 # timestamp fields should be handled as strings if parse_dates
                 # didn't passed explicitly as an array or a dict
                 timestamp_parsers=[""] if isinstance(parse_dates, bool) else None,


Test patch:
Repository: modin-project/modin

Issue:
Add support of write into cloud storage like S3 or GCS for to_csv function
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. What kind of performance improvements would you like to see with this new API?



Discussion:

Resolving patch:
diff --git a/modin/engines/ray/generic/io.py b/modin/engines/ray/generic/io.py
--- a/modin/engines/ray/generic/io.py
+++ b/modin/engines/ray/generic/io.py
@@ -99,6 +99,7 @@ def func(df, **kw):
                 kwargs["path_or_buf"] = io.StringIO()
             df.to_csv(**kwargs)
             content = kwargs["path_or_buf"].getvalue()
+            kwargs["path_or_buf"].close()
 
             # each process waits for its turn to write to a file;
             # in case of violation of the order of receiving messages from the queue,
@@ -110,15 +111,19 @@ def func(df, **kw):
                 queue.put(get_value)
 
             # preparing to write data from the buffer to a file
-            open_kwargs = {"mode": kwargs["mode"]}
-            if not is_binary:
-                # in the buffer, newline symbols have already been translated
-                # for the current operating system;
-                # in the process of writing the buffer to the file,
-                # newline symbols must be left unchanged
-                open_kwargs["newline"] = ""
-            with open(path_or_buf, **open_kwargs) as _f:
-                _f.write(content)
+            with pandas.io.common.get_handle(
+                path_or_buf,
+                # in case when using URL in implicit text mode
+                # pandas try to open `path_or_buf` in binary mode
+                kwargs["mode"] if is_binary else kwargs["mode"] + "t",
+                encoding=kwargs["encoding"],
+                errors=kwargs["errors"],
+                compression=kwargs["compression"],
+                storage_options=kwargs["storage_options"],
+                is_text=False,
+            ) as handles:
+                handles.handle.write(content)
+
             # signal that the next process can start writing to the file
             queue.put(get_value + 1)
 


Test patch:
Repository: modin-project/modin

Issue:
Add `show_history` option to Spreadsheet API
Changes were made to the `modin_spreadsheet` API `show_grid`. Make corresponding changes on Spreadsheet API `from_dataframe`.


Discussion:

Resolving patch:
diff --git a/modin/spreadsheet/general.py b/modin/spreadsheet/general.py
--- a/modin/spreadsheet/general.py
+++ b/modin/spreadsheet/general.py
@@ -18,6 +18,7 @@
 def from_dataframe(
     dataframe,
     show_toolbar=None,
+    show_history=None,
     precision=None,
     grid_options=None,
     column_options=None,
@@ -56,6 +57,9 @@ def from_dataframe(
         Whether to show a toolbar with options for adding/removing rows.
         Adding/removing rows is an experimental feature which only works
         with DataFrames that have an integer index.
+    show_history : bool
+        Whether to show the cell containing the spreadsheet transformation
+        history.
     column_options : dict
         Column options that are to be applied to every column. See the
         Notes section below for more information on the available options,
@@ -171,6 +175,7 @@ def from_dataframe(
     return show_grid(
         dataframe,
         show_toolbar,
+        show_history,
         precision,
         grid_options,
         column_options,


Test patch:
diff --git a/modin/spreadsheet/test/test_general.py b/modin/spreadsheet/test/test_general.py
--- a/modin/spreadsheet/test/test_general.py
+++ b/modin/spreadsheet/test/test_general.py
@@ -24,7 +24,7 @@ def get_test_data():
         "A": 1.0,
         "B": pd.Timestamp("20130102"),
         "C": pd.Series(1, index=list(range(4)), dtype="float32"),
-        "D": np.array([3] * 4, dtype="int32"),
+        "D": np.array([5, 2, 3, 1], dtype="int32"),
         "E": pd.Categorical(["test", "train", "foo", "bar"]),
         "F": ["foo", "bar", "buzz", "fox"],
     }
@@ -41,6 +41,22 @@ def test_from_dataframe():
     with pytest.raises(TypeError):
         mss.from_dataframe(pandas_df)
 
+    # Check parameters don't error
+    def can_edit_row(row):
+        return row["D"] > 2
+
+    modin_result = mss.from_dataframe(
+        modin_df,
+        show_toolbar=True,
+        show_history=True,
+        precision=1,
+        grid_options={"forceFitColumns": False, "filterable": False},
+        column_options={"D": {"editable": True}},
+        column_definitions={"editable": False},
+        row_edit_callback=can_edit_row,
+    )
+    assert isinstance(modin_result, SpreadsheetWidget)
+
 
 def test_to_dataframe():
     data = get_test_data()
Repository: modin-project/modin

Issue:
Document modin.experimental.sklearn
This should include docstrings and purposes of everything inside modin.experimental.sklearn.


Discussion:

Resolving patch:
diff --git a/modin/experimental/sklearn/__init__.py b/modin/experimental/sklearn/__init__.py
--- a/modin/experimental/sklearn/__init__.py
+++ b/modin/experimental/sklearn/__init__.py
@@ -10,3 +10,5 @@
 # the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
 # ANY KIND, either express or implied. See the License for the specific language
 # governing permissions and limitations under the License.
+
+"""Module holds experimental scikit-learn specific functionality for Modin."""
diff --git a/modin/experimental/sklearn/model_selection/__init__.py b/modin/experimental/sklearn/model_selection/__init__.py
--- a/modin/experimental/sklearn/model_selection/__init__.py
+++ b/modin/experimental/sklearn/model_selection/__init__.py
@@ -11,6 +11,8 @@
 # ANY KIND, either express or implied. See the License for the specific language
 # governing permissions and limitations under the License.
 
+"""Module holds model selection specific functionality."""
+
 from .train_test_split import train_test_split
 
 __all__ = ["train_test_split"]


Test patch:
diff --git a/modin/experimental/sklearn/model_selection/train_test_split.py b/modin/experimental/sklearn/model_selection/train_test_split.py
--- a/modin/experimental/sklearn/model_selection/train_test_split.py
+++ b/modin/experimental/sklearn/model_selection/train_test_split.py
@@ -11,8 +11,27 @@
 # ANY KIND, either express or implied. See the License for the specific language
 # governing permissions and limitations under the License.
 
+"""Module holds `train_test_splt` function."""
 
+
+# FIXME: Change `**options`-->`train_size=0.75`
 def train_test_split(df, **options):
+    """
+    Split input data to train and test data.
+
+    Parameters
+    ----------
+    df : modin.pandas.DataFrame / modin.pandas.Series
+        Data to split.
+    **options : dict
+        Keyword arguments. If `train_size` key isn't provided
+        `train_size` will be 0.75.
+
+    Returns
+    -------
+    tuple
+        A pair of modin.pandas.DataFrame / modin.pandas.Series.
+    """
     train_size = options.get("train_size", 0.75)
     train = df.iloc[: int(len(df) * train_size)]
     test = df.iloc[len(train) :]
Repository: modin-project/modin

Issue:
AttributeError: 'int' object has no attribute 'columns'
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: `Ubuntu 20.04`
- **Modin version** (`modin.__version__`): 8fe4be960440e2bac952491685c9e86c64715b78
- **Python version**: `Python 3.8.6`
- **Code we can use to reproduce**:

```python
import modin.pandas as pd
import ray
ray.init()
import numpy as np
data = np.random.randint(0,100,(2**8,2**8))
df = pd.DataFrame(data)
df.to_csv('/tmp/test.csv')
```

<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

### Describe the problem
<!-- Describe the problem clearly here. -->

https://github.com/modin-project/modin/issues/3014#issuecomment-827740232

### Source code / logs
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->

```bash
2021-04-27 21:25:09,427	INFO services.py:1171 -- View the Ray dashboard at http://127.0.0.1:8265
UserWarning: Distributing <class 'numpy.ndarray'> object. This may take some time.
2021-04-27 21:25:14,874	ERROR worker.py:980 -- Possible unhandled error from worker: ray::deploy_ray_func() (pid=4823, ip=192.168.31.208)
  File "python/ray/_raylet.pyx", line 463, in ray._raylet.execute_task
  File "/home/pratik/miniconda3/lib/python3.8/site-packages/modin/engines/ray/pandas_on_ray/frame/axis_partition.py", line 114, in deploy_ray_func
    result = func(*args)
  File "/home/pratik/miniconda3/lib/python3.8/site-packages/modin/engines/base/frame/axis_partition.py", line 294, in deploy_axis_func
    if sum(lengths) != len(result.columns):
AttributeError: 'int' object has no attribute 'columns'
```


Discussion:

Resolving patch:
diff --git a/modin/engines/ray/generic/io.py b/modin/engines/ray/generic/io.py
--- a/modin/engines/ray/generic/io.py
+++ b/modin/engines/ray/generic/io.py
@@ -128,7 +128,7 @@ def func(df, **kw):
             queue.put(get_value + 1)
 
             # used for synchronization purposes
-            return 0
+            return pandas.DataFrame()
 
         # signaling that the partition with id==0 can be written to the file
         queue.put(0)


Test patch:
Repository: modin-project/modin

Issue:
pandas.Series.str.repeats doesn't exist but Modin implements it
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:

Ubuntu 20.04.2 LTS

- **Modin version** (`modin.__version__`):

0.9.1+37.g1eace767.dirty

- **Python version**:

Python 3.8.6

- **Code we can use to reproduce**:

<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

### Describe the problem
<!-- Describe the problem clearly here. -->

There is no such function as `pandas.Series.str.repeats` but it exists in Modin and has tests for it too. Tests pass accidentally because in Modin this function is also not fully implemented and ultimately raises the same `AttributeError` as in Pandas and this makes tests pass.

### Source code / logs
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->



Discussion:

Resolving patch:
diff --git a/modin/pandas/series_utils.py b/modin/pandas/series_utils.py
--- a/modin/pandas/series_utils.py
+++ b/modin/pandas/series_utils.py
@@ -203,9 +203,6 @@ def replace(self, pat, repl, n=-1, case=None, flags=0, regex=True):
             )
         )
 
-    def repeats(self, repeats):
-        return Series(query_compiler=self._query_compiler.str_repeats(repeats))
-
     def pad(self, width, side="left", fillchar=" "):
         if len(fillchar) != 1:
             raise TypeError("fillchar must be a character, not str")


Test patch:
diff --git a/modin/pandas/test/test_series.py b/modin/pandas/test/test_series.py
--- a/modin/pandas/test/test_series.py
+++ b/modin/pandas/test/test_series.py
@@ -3633,16 +3633,16 @@ def test_str_replace(data, pat, repl, n, case):
 
 @pytest.mark.parametrize("data", test_string_data_values, ids=test_string_data_keys)
 @pytest.mark.parametrize("repeats", int_arg_values, ids=int_arg_keys)
-def test_str_repeats(data, repeats):
+def test_str_repeat(data, repeats):
     modin_series, pandas_series = create_test_series(data)
 
     try:
-        pandas_result = pandas_series.str.repeats(repeats)
+        pandas_result = pandas_series.str.repeat(repeats)
     except Exception as e:
         with pytest.raises(type(e)):
-            modin_series.str.repeats(repeats)
+            modin_series.str.repeat(repeats)
     else:
-        modin_result = modin_series.str.repeats(repeats)
+        modin_result = modin_series.str.repeat(repeats)
         df_equals(modin_result, pandas_result)
Repository: modin-project/modin

Issue:
_inherit_docstrings does not wrap classmethods and own attributes
> Another problem with `doc_checker` is that for file `modin/pandas/accessor.py` from PR #3022 I get errors about functions `from_spmatrix` and `from_coo` although docstrings for these functions should be inherited.

The problem has to do with how `_inherit_docstrings` handle functions with `classmethod` decorator. cc @vnlitvinov

_Originally posted by @anmyachev in https://github.com/modin-project/modin/issues/2995#issuecomment-828629542_


Discussion:

Resolving patch:
diff --git a/modin/utils.py b/modin/utils.py
--- a/modin/utils.py
+++ b/modin/utils.py
@@ -156,8 +156,8 @@ def _inherit_docstrings(parent, excluded=[], overwrite_existing=False, apilink=N
     Create a decorator which overwrites decorated object docstring(s).
 
     It takes `parent` __doc__ attribute. Also overwrites __doc__ of
-    methods and properties defined in the target if it's a class with the __doc__ of
-    matching methods and properties from the `parent`.
+    methods and properties defined in the target or its ancestors if it's a class
+    with the __doc__ of matching methods and properties from the `parent`.
 
     Parameters
     ----------
@@ -177,6 +177,12 @@ def _inherit_docstrings(parent, excluded=[], overwrite_existing=False, apilink=N
     -------
     callable
         Decorator which replaces the decorated object's documentation with `parent` documentation.
+
+    Notes
+    -----
+    Keep in mind that the function will override docstrings even for attributes which
+    are not defined in target class (but are defined in the ancestor class),
+    which means that ancestor class attribute docstrings could also change.
     """
 
     def _documentable_obj(obj):
@@ -192,10 +198,14 @@ def decorator(cls_or_func):
             _replace_doc(parent, cls_or_func, overwrite_existing, apilink)
 
         if not isinstance(cls_or_func, types.FunctionType):
+            seen = set()
             for base in cls_or_func.__mro__:
                 if base is object:
                     continue
                 for attr, obj in base.__dict__.items():
+                    if attr in seen:
+                        continue
+                    seen.add(attr)
                     parent_obj = getattr(parent, attr, None)
                     if (
                         parent_obj in excluded


Test patch:
diff --git a/modin/test/test_utils.py b/modin/test/test_utils.py
--- a/modin/test/test_utils.py
+++ b/modin/test/test_utils.py
@@ -114,3 +114,18 @@ def test_doc_inherit_props(wrapped_cls):
     assert type(wrapped_cls.method) == type(BaseChild.method)  # noqa: E721
     _check_doc(wrapped_cls.prop, BaseChild.prop)
     _check_doc(wrapped_cls.F, BaseChild.F)
+
+
+def test_doc_inherit_prop_builder():
+    def builder(name):
+        return property(lambda self: name)
+
+    class Parent:
+        prop = builder("Parent")
+
+    @modin.utils._inherit_docstrings(Parent)
+    class Child(Parent):
+        prop = builder("Child")
+
+    assert Parent().prop == "Parent"
+    assert Child().prop == "Child"