From 83ea015964b945af3bd423e915373be453551e02 Mon Sep 17 00:00:00 2001 From: Richard Shadrach <45562402+rhshadrach@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:52:10 -0500 Subject: [PATCH 1/3] TST(string dtype): Resolve xfail when grouping by nan column (#60712) (cherry picked from commit 55a6d0a613897040fec1ae11adc15f5f04728032) --- pandas/tests/groupby/test_groupby.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pandas/tests/groupby/test_groupby.py b/pandas/tests/groupby/test_groupby.py index b5588898d4580..07ddbc36b5ab0 100644 --- a/pandas/tests/groupby/test_groupby.py +++ b/pandas/tests/groupby/test_groupby.py @@ -6,8 +6,6 @@ import numpy as np import pytest -from pandas._config import using_string_dtype - from pandas.errors import ( PerformanceWarning, SpecificationError, @@ -2876,12 +2874,13 @@ def test_groupby_none_in_first_mi_level(): tm.assert_series_equal(result, expected) -@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)") -def test_groupby_none_column_name(): +def test_groupby_none_column_name(using_infer_string): # GH#47348 df = DataFrame({None: [1, 1, 2, 2], "b": [1, 1, 2, 3], "c": [4, 5, 6, 7]}) - result = df.groupby(by=[None]).sum() - expected = DataFrame({"b": [2, 5], "c": [9, 13]}, index=Index([1, 2], name=None)) + by = [np.nan] if using_infer_string else [None] + gb = df.groupby(by=by) + result = gb.sum() + expected = DataFrame({"b": [2, 5], "c": [9, 13]}, index=Index([1, 2], name=by[0])) tm.assert_frame_equal(result, expected) From 22487827b4128dce705516fe5623cd3e9f6a065a Mon Sep 17 00:00:00 2001 From: richard Date: Sat, 22 Nov 2025 20:29:45 -0500 Subject: [PATCH 2/3] Kickoff CI From b7286115c2ab20322d287cd850c6f8c16c645d2e Mon Sep 17 00:00:00 2001 From: richard Date: Sat, 22 Nov 2025 20:31:04 -0500 Subject: [PATCH 3/3] Make change --- pandas/core/groupby/groupby.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 5baa2a9b703cc..e4d1789a70594 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -2218,6 +2218,8 @@ def all(self, skipna: bool = True) -> NDFrameT: """ Return True if all values in the group are truthful, else False. + Test change. + Parameters ---------- skipna : bool, default True