Skip to content

TEST: Speed up GroupBy test setup - #24014

Merged
rapids-bot[bot] merged 12 commits into
NVIDIA:mainfrom
vyasr:codex/speed-up-groupby-test-setup
Sep 7, 2026
Merged

TEST: Speed up GroupBy test setup#24014
rapids-bot[bot] merged 12 commits into
NVIDIA:mainfrom
vyasr:codex/speed-up-groupby-test-setup

Conversation

@vyasr

@vyasr vyasr commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Description

Reuse read-only GroupBy source data and coalesce cases that execute the same JIT-generated UDF so a pytest worker can reuse its process-local compilation cache. Each original dataset, dtype, special value, assertion, warning check, and expected-failure path still executes; tests copy inputs before mutation. The duplicate lambda x: x.nunique() spelling is removed because it exercises the same GroupBy reduction as the existing "nunique" case.

Checklist

  • I am familiar with the CONTRIBUTING.md guidelines.
  • New or existing tests cover these test-only changes.
  • Documentation updates are not needed.

@vyasr
vyasr requested a review from a team as a code owner September 6, 2026 23:46
@vyasr vyasr added tests Unit testing for project Python Affects Python cuDF API. Performance Performance related issue labels Sep 6, 2026
@vyasr
vyasr requested a review from bdice September 6, 2026 23:46
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f2fa0b5d-61af-466b-928e-95223eeb3420

📥 Commits

Reviewing files that changed from the base of the PR and between a8ad204 and 5ec0259.

📒 Files selected for processing (5)
  • python/cudf/cudf/tests/groupby/test_apply.py
  • python/cudf/cudf/tests/groupby/test_head_tail.py
  • python/cudf/cudf/tests/groupby/test_nunique.py
  • python/cudf/cudf/tests/groupby/test_sample.py
  • python/cudf/cudf/tests/groupby/test_transform.py

Included review availability: Your plan provides up to 12 included reviews per hour; 6 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Tests
    • Expanded groupby test coverage for null keys and values, special values, correlations, and large datasets.
    • Improved comparisons between cuDF and pandas results for transform operations.
    • Streamlined reduction, uniqueness, sampling, and index-related test cases.
    • Improved test fixture reuse and documented read-only data expectations, reducing unnecessary setup and improving test efficiency.

Walkthrough

Changes

Groupby test updates

Layer / File(s) Summary
Shared fixture lifecycle and data construction
python/cudf/cudf/tests/groupby/test_apply.py, python/cudf/cudf/tests/groupby/test_head_tail.py, python/cudf/cudf/tests/groupby/test_sample.py, python/cudf/cudf/tests/groupby/test_transform.py
Fixtures now use module scope. Large datasets use CuPy tiling. Tests document read-only fixture use. Transform tests reuse a precomputed pandas reference.
Reduction and correlation coverage
python/cudf/cudf/tests/groupby/test_apply.py
Unary reduction, index-reduction, and correlation tests reuse copied datasets and consolidate special-value, warning, and expected-failure handling.
Focused groupby assertions
python/cudf/cudf/tests/groupby/test_nunique.py
The nunique test directly checks groupby(...).nunique() without aggregation-form parametrization.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 5ec02

The test optimization preserves the existing GroupBy test behavior and coverage contracts, with no current merge-blocking risk identified.

Suggested reviewers: mroeschke, matt711, galipremsagar

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.64% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: speeding up GroupBy test setup.
Description check ✅ Passed The description directly explains reuse of read-only test data and JIT caches while preserving test coverage and assertions.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@vyasr vyasr added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Sep 7, 2026
@bdice

bdice commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit c27d94e into NVIDIA:main Sep 7, 2026
114 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in cuDF Python Sep 7, 2026
@vyasr
vyasr deleted the codex/speed-up-groupby-test-setup branch September 7, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Performance Performance related issue Python Affects Python cuDF API. tests Unit testing for project

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants