From 3d016ab6ed84106f4032fcd33081f31f1bf121bf Mon Sep 17 00:00:00 2001 From: Devpriya Dave Date: Wed, 6 Dec 2023 17:48:14 -0500 Subject: [PATCH 1/3] Update .gitpod.yml --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 9222639136a17..5c8b2d871291c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -45,7 +45,7 @@ github: # enable for main/default branch main: true # enable for other branches (defaults to false) - branches: false + branches: true # enable for pull requests coming from this repo (defaults to true) pullRequests: false # enable for pull requests coming from forks (defaults to false) From dcb2ab45c31635c91cc294b0367a2ab66b33e512 Mon Sep 17 00:00:00 2001 From: Devpriya Dave Date: Wed, 17 Jan 2024 16:59:10 -0500 Subject: [PATCH 2/3] Add test groupby transform with no column --- pandas/tests/groupby/transform/test_transform.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pandas/tests/groupby/transform/test_transform.py b/pandas/tests/groupby/transform/test_transform.py index 35699fe9647d7..bfa01812c8efd 100644 --- a/pandas/tests/groupby/transform/test_transform.py +++ b/pandas/tests/groupby/transform/test_transform.py @@ -650,6 +650,16 @@ def test_groupby_transform_with_nan_group(): expected = Series([1.0, 1.0, 2.0, 3.0, np.nan, 6.0, 6.0, 9.0, 9.0, 9.0], name="a") tm.assert_series_equal(result, expected) +def test_groupby_transform_with_no_column(): + # GH 49864 + df = pd.DataFrame({0: [1.0]}) + gb = df.groupby(pd.Series(["a"]), as_index=False) + msg = "A grouping was used that is not in the columns of the DataFrame" + with tm.assert_produces_warning(FutureWarning, match=msg): + result = gb.sum() + tm.assert_frame_equal(result, df) + + def test_transform_mixed_type(): index = MultiIndex.from_arrays([[0, 0, 0, 1, 1, 1], [1, 2, 3, 1, 2, 3]]) From 39b1929afc76323baf040c453e6813400963ee85 Mon Sep 17 00:00:00 2001 From: Devpriya Dave Date: Wed, 17 Jan 2024 17:15:57 -0500 Subject: [PATCH 3/3] undo gitpod changes --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 5c8b2d871291c..9222639136a17 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -45,7 +45,7 @@ github: # enable for main/default branch main: true # enable for other branches (defaults to false) - branches: true + branches: false # enable for pull requests coming from this repo (defaults to true) pullRequests: false # enable for pull requests coming from forks (defaults to false)