Skip to content

Fix groupby.apply columns axis name for row-like UDF results - #22809

Merged
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
galipremsagar:gb_fix_5
Jun 10, 2026
Merged

Fix groupby.apply columns axis name for row-like UDF results#22809
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
galipremsagar:gb_fix_5

Conversation

@galipremsagar

@galipremsagar galipremsagar commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes a cudf.pandas correctness bug in DataFrameGroupBy.apply: when the UDF returns a row-like Series (e.g. x.iloc[0]), the result's columns axis now inherits that Series' name to match pandas, instead of being left unnamed.
Re-enables the now-passing test_callable_result_dtype_frame cases in the pandas-test plugin.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@github-actions github-actions Bot added Python Affects Python cuDF API. cudf.pandas Issues specific to cudf.pandas labels Jun 8, 2026
@GPUtester GPUtester moved this to In Progress in cuDF Python Jun 8, 2026
@galipremsagar galipremsagar changed the title fix Fix groupby.apply columns axis name for row-like UDF results Jun 8, 2026
@galipremsagar
galipremsagar marked this pull request as ready for review June 8, 2026 20:34
@galipremsagar
galipremsagar requested a review from a team as a code owner June 8, 2026 20:34
@galipremsagar
galipremsagar requested review from vyasr and wence- June 8, 2026 20:34
@galipremsagar galipremsagar added bug Something isn't working non-breaking Non-breaking change 3 - Ready for Review Ready for review by team labels Jun 8, 2026
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

GroupBy.apply for row-like Series outputs now explicitly preserves the columns-axis name after transposing and concatenating results. The corresponding test entries are removed from the failure registry, indicating those tests now pass with the fix.

Changes

GroupBy apply columns metadata

Layer / File(s) Summary
Preserve columns-axis name in groupby.apply
python/cudf/cudf/core/groupby/groupby.py, python/cudf/cudf/pandas/scripts/pandas-testing-plugin.py
In _post_process_chunk_results, the columns-axis name is explicitly set from the first chunk's Series name after transpose/concat operations. A large block of test_callable_result_dtype_frame[apply-...] test entries is removed from the pandas testing plugin's failure registry, reflecting that these tests now pass.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

bug, non-breaking

Suggested reviewers

  • TomAugspurger
  • mroeschke
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: fixing the columns axis name for row-like UDF results in groupby.apply.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description clearly explains the bug fix for cudf.pandas correctness in DataFrameGroupBy.apply and references the related code changes documented in the raw summary.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@galipremsagar

Copy link
Copy Markdown
Contributor Author

/merge

@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Jun 10, 2026
@rapids-bot
rapids-bot Bot merged commit 502bdad into NVIDIA:main Jun 10, 2026
124 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python Jun 10, 2026
abigalekim pushed a commit to abigalekim/cudf that referenced this pull request Jun 12, 2026
…22809)

Fixes a `cudf.pandas` correctness bug in `DataFrameGroupBy.apply`: when the UDF returns a row-like Series (e.g. `x.iloc[0]`), the result's columns axis now inherits that Series' name to match pandas, instead of being left unnamed.
Re-enables the now-passing `test_callable_result_dtype_frame` cases in the pandas-test plugin.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: NVIDIA#22809
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working cudf.pandas Issues specific to cudf.pandas non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants