Repository: modin-project/modin

Issue:
Add `skipna` parameter to some `groupby` and `resample` methods
Pandas added `skipna` parameter to some groupby methods in their patch release 2.2.1:
https://pandas.pydata.org/pandas-docs/version/2.2.1/whatsnew/v2.2.1.html#other

Because of that, our API equality testing fails:
https://github.com/modin-project/modin/actions/runs/8050522351/job/21986305608?pr=6966


Discussion:

Patch:
diff --git a/modin/pandas/groupby.py b/modin/pandas/groupby.py
--- a/modin/pandas/groupby.py
+++ b/modin/pandas/groupby.py
@@ -682,17 +682,17 @@ def dtypes(self):
             )
         )
 
-    def first(self, numeric_only=False, min_count=-1):
+    def first(self, numeric_only=False, min_count=-1, skipna=True):
         return self._wrap_aggregation(
             type(self._query_compiler).groupby_first,
-            agg_kwargs=dict(min_count=min_count),
+            agg_kwargs=dict(min_count=min_count, skipna=skipna),
             numeric_only=numeric_only,
         )
 
-    def last(self, numeric_only=False, min_count=-1):
+    def last(self, numeric_only=False, min_count=-1, skipna=True):
         return self._wrap_aggregation(
             type(self._query_compiler).groupby_last,
-            agg_kwargs=dict(min_count=min_count),
+            agg_kwargs=dict(min_count=min_count, skipna=skipna),
             numeric_only=numeric_only,
         )
 
diff --git a/modin/pandas/series.py b/modin/pandas/series.py
--- a/modin/pandas/series.py
+++ b/modin/pandas/series.py
@@ -706,13 +706,19 @@ def argmin(self, axis=None, skipna=True, *args, **kwargs):  # noqa: PR01, RT01,
             result = -1
         return result
 
-    def argsort(self, axis=0, kind="quicksort", order=None):  # noqa: PR01, RT01, D200
+    def argsort(
+        self, axis=0, kind="quicksort", order=None, stable=None
+    ):  # noqa: PR01, RT01, D200
         """
         Return the integer indices that would sort the Series values.
         """
         return self.__constructor__(
             query_compiler=self._query_compiler.argsort(
-                axis=axis, kind=kind, order=order
+                # 'stable' parameter has no effect in Pandas and is only accepted
+                # for compatibility with NumPy, so we're not passing it forward on purpose
+                axis=axis,
+                kind=kind,
+                order=order,
             )
         )
 


Test patch:
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
@@ -3440,3 +3440,19 @@ def func(df):
             func, include_groups=include_groups
         ),
     )
+
+
+@pytest.mark.parametrize("skipna", [True, False])
+@pytest.mark.parametrize("how", ["first", "last"])
+def test_first_last_skipna(how, skipna):
+    md_df, pd_df = create_test_dfs(
+        {
+            "a": [2, 1, 1, 2, 3, 3] * 20,
+            "b": [np.nan, 3.0, np.nan, 4.0, np.nan, np.nan] * 20,
+            "c": [np.nan, 3.0, np.nan, 4.0, np.nan, np.nan] * 20,
+        }
+    )
+
+    pd_res = getattr(pd_df.groupby("a"), how)(skipna=skipna)
+    md_res = getattr(md_df.groupby("a"), how)(skipna=skipna)
+    df_equals(md_res, pd_res)