Repository: modin-project/modin

Issue:
Update the minimum supported python version up to 3.9
New pandas release 2.1.0 [drop](https://pandas.pydata.org/pandas-docs/version/2.1.0rc0/whatsnew/v2.1.0.html#backwards-incompatible-api-changes) support for python 3.8. Modin needs to do the same.


Discussion:

Resolving patch:
diff --git a/modin/pandas/groupby.py b/modin/pandas/groupby.py
--- a/modin/pandas/groupby.py
+++ b/modin/pandas/groupby.py
@@ -1690,12 +1690,6 @@ def _try_get_str_func(self, fn):
         """
         if not isinstance(fn, str) and isinstance(fn, Iterable):
             return [self._try_get_str_func(f) for f in fn]
-        if fn is np.max:
-            # np.max is called "amax", so it's not a method of the groupby object.
-            return "amax"
-        elif fn is np.min:
-            # np.min is called "amin", so it's not a method of the groupby object.
-            return "amin"
         return fn.__name__ if callable(fn) and fn.__name__ in dir(self) else fn
 
     def value_counts(
diff --git a/modin/utils.py b/modin/utils.py
--- a/modin/utils.py
+++ b/modin/utils.py
@@ -25,10 +25,7 @@
 import codecs
 import functools
 
-if sys.version_info < (3, 8):
-    from typing_extensions import Protocol, runtime_checkable
-else:
-    from typing import Protocol, runtime_checkable
+from typing import Protocol, runtime_checkable
 
 from textwrap import dedent, indent
 from packaging import version
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -63,5 +63,5 @@ def make_distribution(self):
         "sql": sql_deps,
         "all": all_deps,
     },
-    python_requires=">=3.8",
+    python_requires=">=3.9",
 )


Test patch:
diff --git a/modin/numpy/test/test_array_arithmetic.py b/modin/numpy/test/test_array_arithmetic.py
--- a/modin/numpy/test/test_array_arithmetic.py
+++ b/modin/numpy/test/test_array_arithmetic.py
@@ -101,18 +101,8 @@ def test_basic_arithmetic_with_broadcast(operand1_shape, operand2_shape, operato
         "__gt__",
         "__lt__",
         "__le__",
-        pytest.param(
-            "__eq__",
-            marks=pytest.mark.xfail(
-                reason="numpy behavior on eq/ne is counterintuitive: see GH#5893"
-            ),
-        ),
-        pytest.param(
-            "__ne__",
-            marks=pytest.mark.xfail(
-                reason="numpy behavior on eq/ne is counterintuitive: see GH#5893"
-            ),
-        ),
+        "__eq__",
+        "__ne__",
     ],
 )
 def test_binary_bad_broadcast(matched_axis, operator):
diff --git a/modin/pandas/test/dataframe/test_default.py b/modin/pandas/test/dataframe/test_default.py
--- a/modin/pandas/test/dataframe/test_default.py
+++ b/modin/pandas/test/dataframe/test_default.py
@@ -11,7 +11,6 @@
 # ANY KIND, either express or implied. See the License for the specific language
 # governing permissions and limitations under the License.
 
-import sys
 import pytest
 import numpy as np
 import pandas
@@ -79,8 +78,6 @@
 )
 def test_ops_defaulting_to_pandas(op, make_args):
     modin_df = pd.DataFrame(test_data_diff_dtype).drop(["str_col", "bool_col"], axis=1)
-    if op == "to_xarray" and sys.version_info < (3, 9):
-        pytest.skip("xarray doesn't support pandas>=2.0 for python 3.8")
     with warns_that_defaulting_to_pandas():
         operation = getattr(modin_df, op)
         if make_args is not None:
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
@@ -13,7 +13,6 @@
 
 from __future__ import annotations
 
-import sys
 import pytest
 import unittest.mock as mock
 import numpy as np
@@ -3539,10 +3538,6 @@ def test_to_timestamp():
         series.to_period().to_timestamp()
 
 
-@pytest.mark.skipif(
-    condition=sys.version_info < (3, 9),
-    reason="xarray doesn't support pandas>=2.0 for python 3.8",
-)
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
 def test_to_xarray(data):
     modin_series, _ = create_test_series(data)  # noqa: F841