diff --git a/python/cudf/cudf/core/groupby/groupby.py b/python/cudf/cudf/core/groupby/groupby.py index e89b7c3c7590..94ea764abae3 100644 --- a/python/cudf/cudf/core/groupby/groupby.py +++ b/python/cudf/cudf/core/groupby/groupby.py @@ -2145,6 +2145,13 @@ def _post_process_chunk_results( result = concat(chunk_results, axis=1).T result.index = group_names result.index.names = self.grouping.names + # pandas names the columns axis after the row-like Series + # returned by the UDF (e.g. ``iloc[0]`` carries the original + # row label as its name); ``concat(..., axis=1).T`` otherwise + # drops it, leaving an unnamed columns axis. + result.columns = result.columns.set_names( + [chunk_results[0].name] + ) # When the UDF is like df.x + df.y, the result for each # group is the same length as the original group elif (total_rows := sum(len(chk) for chk in chunk_results)) in { diff --git a/python/cudf/cudf/pandas/scripts/pandas-testing-plugin.py b/python/cudf/cudf/pandas/scripts/pandas-testing-plugin.py index 516c24efaa68..6c334e8b68e7 100644 --- a/python/cudf/cudf/pandas/scripts/pandas-testing-plugin.py +++ b/python/cudf/cudf/pandas/scripts/pandas-testing-plugin.py @@ -2201,56 +2201,6 @@ def pytest_unconfigure(config): "tests/groupby/aggregate/test_aggregate.py::test_agg_str_with_kwarg_axis_1_raises[max]": "TODO: Add a reason for failure", "tests/groupby/aggregate/test_aggregate.py::test_agg_str_with_kwarg_axis_1_raises[min]": "TODO: Add a reason for failure", "tests/groupby/aggregate/test_aggregate.py::test_agg_str_with_kwarg_axis_1_raises[nunique]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-bool-bool-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-bool-bool-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-bool-float32-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-bool-float32-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-bool-float64-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-bool-float64-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-bool-int32-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-bool-int32-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-bool-int64-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-bool-int64-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float32-bool-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float32-bool-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float32-float32-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float32-float32-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float32-float64-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float32-float64-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float32-int32-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float32-int32-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float32-int64-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float32-int64-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float64-bool-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float64-bool-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float64-float32-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float64-float32-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float64-float64-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float64-float64-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float64-int32-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float64-int32-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float64-int64-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-float64-int64-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int32-bool-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int32-bool-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int32-float32-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int32-float32-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int32-float64-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int32-float64-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int32-int32-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int32-int32-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int32-int64-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int32-int64-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int64-bool-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int64-bool-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int64-float32-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int64-float32-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int64-float64-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int64-float64-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int64-int32-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int64-int32-keys1-agg_index1]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int64-int64-keys0-agg_index0]": "TODO: Add a reason for failure", - "tests/groupby/aggregate/test_aggregate.py::test_callable_result_dtype_frame[apply-int64-int64-keys1-agg_index1]": "TODO: Add a reason for failure", "tests/groupby/aggregate/test_aggregate.py::test_groupby_aggregate_directory[size]": "TODO: Add a reason for failure", "tests/groupby/aggregate/test_aggregate.py::test_groupby_aggregate_empty_key_empty_return": "TODO: Add a reason for failure", "tests/groupby/aggregate/test_aggregate.py::test_groupby_aggregate_empty_with_multiindex_frame": "AssertionError: DataFrame.index level [0] are different",