Repository: modin-project/modin

Issue:
rmod returns wrong result
<!--
General questions should be asked on the mailing list modin-dev@googlegroups.com.

Before submitting an issue, please fill out the following form.
-->

### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
- **Modin installed from (source or binary)**:
- **Modin version**:
- **Python version**:
- **Exact command to reproduce**:

<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

### Describe the problem
`rmod` returns wrong result

### Source code / logs
```
import modin.pandas as pd
import pandas
data = {
    "col3": [np.NaN, 2, np.NaN, 0],
    "col4": [3, 4, np.NaN, 1],
    "col1": [np.NaN, np.NaN, np.NaN, 5],
    "col2": [6, np.NaN, np.NaN, 10],
}
modin_df = pd.DataFrame(data)
pandas_df = pandas.DataFrame(data)
modin_df.rmod(4)
```


Discussion:

Resolving patch:
diff --git a/modin/data_management/query_compiler/pandas_query_compiler.py b/modin/data_management/query_compiler/pandas_query_compiler.py
--- a/modin/data_management/query_compiler/pandas_query_compiler.py
+++ b/modin/data_management/query_compiler/pandas_query_compiler.py
@@ -619,6 +619,18 @@ def rdiv(self, other, **kwargs):
         func = pandas.DataFrame.rdiv
         return self._inter_df_op_handler(func, other, **kwargs)
 
+    def rmod(self, other, **kwargs):
+        """Mods other object (manager or scalar) with this manager.
+
+        Args:
+            other: The other object (manager or scalar).
+
+        Returns:
+            New DataManager with divided data and new index.
+        """
+        func = pandas.DataFrame.rmod
+        return self._inter_df_op_handler(func, other, **kwargs)
+
     def rpow(self, other, **kwargs):
         """Exponential power of other object (manager or scalar) to this manager.
 
diff --git a/modin/pandas/dataframe.py b/modin/pandas/dataframe.py
--- a/modin/pandas/dataframe.py
+++ b/modin/pandas/dataframe.py
@@ -3200,7 +3200,32 @@ def rfloordiv(self, other, axis="columns", level=None, fill_value=None):
         return self.floordiv(other, axis, level, fill_value)
 
     def rmod(self, other, axis="columns", level=None, fill_value=None):
-        return self.mod(other, axis, level, fill_value)
+        """Mod this DataFrame against another DataFrame/Series/scalar.
+
+        Args:
+            other: The object to use to apply the div against this.
+            axis: The axis to div over.
+            level: The Multilevel index level to apply div over.
+            fill_value: The value to fill NaNs with.
+
+        Returns:
+            A new DataFrame with the rdiv applied.
+        """
+        if level is not None:
+            if isinstance(other, DataFrame):
+                other = other._query_compiler.to_pandas()
+            return self._default_to_pandas(
+                pandas.DataFrame.rmod,
+                other,
+                axis=axis,
+                level=level,
+                fill_value=fill_value,
+            )
+        other = self._validate_other(other, axis, numeric_only=True)
+        new_query_compiler = self._query_compiler.rmod(
+            other=other, axis=axis, level=level, fill_value=fill_value
+        )
+        return self._create_dataframe_from_compiler(new_query_compiler)
 
     def rmul(self, other, axis="columns", level=None, fill_value=None):
         return self.mul(other, axis, level, fill_value)


Test patch: