Repository: modin-project/modin

Issue:
Upgrade pandas to 1.5.1



Discussion:

Resolving patch:
diff --git a/modin/pandas/__init__.py b/modin/pandas/__init__.py
--- a/modin/pandas/__init__.py
+++ b/modin/pandas/__init__.py
@@ -30,7 +30,7 @@
             f"Starting Modin in compatibility mode to support legacy pandas version {__pandas_version__}"
         )
 elif PandasCompatVersion.CURRENT == PandasCompatVersion.LATEST:
-    __pandas_version__ = "1.5.0"
+    __pandas_version__ = "1.5.1"
 
     if pandas.__version__ != __pandas_version__:
         warnings.warn(
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
 import versioneer
 import sys
 
-PANDAS_VERSION = "1.5.0" if sys.version_info >= (3, 8) else "1.1.5"
+PANDAS_VERSION = "1.5.1" if sys.version_info >= (3, 8) else "1.1.5"
 
 with open("README.md", "r", encoding="utf-8") as fh:
     long_description = fh.read()


Test patch:
diff --git a/modin/pandas/test/dataframe/test_udf.py b/modin/pandas/test/dataframe/test_udf.py
--- a/modin/pandas/test/dataframe/test_udf.py
+++ b/modin/pandas/test/dataframe/test_udf.py
@@ -152,14 +152,6 @@ def test_apply_key_error(func):
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
 @pytest.mark.parametrize("func", ["kurt", "count", "sum", "mean", "all", "any"])
 def test_apply_text_func_with_level(level, data, func, axis):
-    if (
-        func in ("any", "all")
-        and axis == 1
-        and PandasCompatVersion.CURRENT == PandasCompatVersion.LATEST
-    ):
-        pytest.xfail(
-            "df.apply('str', axis=1) is broken in pandas 1.5.0: https://github.com/modin-project/modin/issues/5076"
-        )
     func_kwargs = {"level": level, "axis": axis}
     rows_number = len(next(iter(data.values())))  # length of the first data column
     level_0 = np.random.choice([0, 1, 2], rows_number)
diff --git a/modin/pandas/test/test_groupby.py b/modin/pandas/test/test_groupby.py
--- a/modin/pandas/test/test_groupby.py
+++ b/modin/pandas/test/test_groupby.py
@@ -874,9 +874,7 @@ def test_simple_col_groupby():
     )
     eval_fillna(modin_groupby, pandas_groupby)
     eval_count(modin_groupby, pandas_groupby)
-    if PandasCompatVersion.CURRENT != PandasCompatVersion.LATEST:
-        # due to https://github.com/modin-project/modin/issues/5078, that would fail on pandas 1.5.0
-        eval_size(modin_groupby, pandas_groupby)
+    eval_size(modin_groupby, pandas_groupby)
     eval_general(modin_groupby, pandas_groupby, lambda df: df.take())
     eval_groups(modin_groupby, pandas_groupby)
 
@@ -1363,9 +1361,7 @@ def test_groupby_multiindex(groupby_kwargs):
     )
     modin_groupby_equals_pandas(md_grp, pd_grp)
     df_equals(md_grp.sum(), pd_grp.sum())
-    if PandasCompatVersion.CURRENT != PandasCompatVersion.LATEST:
-        # due to https://github.com/modin-project/modin/issues/5078, that would fail on pandas 1.5.0
-        df_equals(md_grp.size(), pd_grp.size())
+    df_equals(md_grp.size(), pd_grp.size())
     # Grouping on level works incorrect in case of aggregation:
     # https://github.com/modin-project/modin/issues/2912
     # df_equals(md_grp.quantile(), pd_grp.quantile())
@@ -1440,13 +1436,7 @@ def test_groupby_with_kwarg_dropna(groupby_kwargs, dropna):
         and any(col in modin_df.columns for col in by_kwarg)
     ):
         df_equals(md_grp.sum(), pd_grp.sum())
-        if not (
-            groupby_kwargs == {"level": 1, "axis": 1}
-            and PandasCompatVersion.CURRENT == PandasCompatVersion.LATEST
-        ):
-            # skip the check for df.groupby().size() on pandas 1.5.0
-            # as it's failing due to pandas bug: https://github.com/modin-project/modin/issues/5078
-            df_equals(md_grp.size(), pd_grp.size())
+        df_equals(md_grp.size(), pd_grp.size())
     # Grouping on level works incorrect in case of aggregation:
     # https://github.com/modin-project/modin/issues/2912
     # "BaseOnPython" tests are disabled because of the bug: