Repository: modin-project/modin

Issue:
Series functions with level parameter produces Series with sorted index while Pandas doesn't do this
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Linux Ubuntu 18.04
- **Modin version** (`modin.__version__`): 0.7.3+197.g8602fc0
- **Python version**: 3.8.3
- **Code we can use to reproduce**:
```
import pandas
import numpy as np

from modin.pandas.test.utils import test_data
from modin.pandas.test.test_series import create_test_series

s_modin, s_pandas = create_test_series(test_data["dense_nan_data"])
rows_number = len(s_modin.index)
level_0 = np.random.choice([x for x in range(10)], rows_number)
level_1 = np.random.choice([x for x in range(10)], rows_number)
index = pandas.MultiIndex.from_arrays([level_0, level_1])

s_modin.index = index
s_pandas.index = index

print("s_modin.all(level=0).index", s_modin.all(level=0).index) # Int64Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='int64')
print("s_pandas.all(level=0).index", s_pandas.all(level=0).index) # Int64Index([1, 5, 8, 2, 4, 7, 9, 3, 6, 0], dtype='int64')

print("s_modin.any(level=0).index", s_modin.any(level=0).index) #  Int64Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='int64')
print("s_pandas.any(level=0).index", s_pandas.any(level=0).index) # Int64Index([1, 5, 8, 2, 4, 7, 9, 3, 6, 0], dtype='int64')

print("s_modin.mad(level=0).index", s_modin.mad(level=0).index) # Int64Index([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype='int64')
print("s_pandas.mad(level=0).index", s_pandas.mad(level=0).index) # Int64Index([1, 5, 8, 2, 4, 7, 9, 3, 6, 0], dtype='int64')
```

<!--
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:

Resolving patch:
diff --git a/modin/pandas/base.py b/modin/pandas/base.py
--- a/modin/pandas/base.py
+++ b/modin/pandas/base.py
@@ -124,7 +124,7 @@ def _handle_level_agg(self, axis, level, op, **kwargs):
             level: The level of the axis to apply the operation on
             op: String representation of the operation to be performed on the level
         """
-        return getattr(self.groupby(level=level, axis=axis), op)(**kwargs)
+        return getattr(self.groupby(level=level, axis=axis, sort=False), op)(**kwargs)
 
     def _validate_other(
         self,


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
@@ -28,6 +28,7 @@
     df_equals,
     arg_keys,
     name_contains,
+    test_data,
     test_data_values,
     test_data_keys,
     test_string_data_values,
@@ -1802,6 +1803,24 @@ def test_last():
     df_equals(modin_series.last("20D"), pandas_series.last("20D"))
 
 
+def test_index_order():
+    # see #1708 for details
+    s_modin, s_pandas = create_test_series(test_data["dense_nan_data"])
+    rows_number = len(s_modin.index)
+    level_0 = np.random.choice([x for x in range(10)], rows_number)
+    level_1 = np.random.choice([x for x in range(10)], rows_number)
+    index = pandas.MultiIndex.from_arrays([level_0, level_1])
+
+    s_modin.index = index
+    s_pandas.index = index
+
+    for func in ["all", "any", "mad"]:
+        df_equals(
+            getattr(s_modin, func)(level=0).index,
+            getattr(s_pandas, func)(level=0).index,
+        )
+
+
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
 def test_last_valid_index(data):
     modin_series, pandas_series = create_test_series(data)