Skip to content

TEST: Reuse Python test inputs - #24127

Open
vyasr wants to merge 1 commit into
NVIDIA:mainfrom
vyasr:codex/reuse-python-test-inputs
Open

TEST: Reuse Python test inputs#24127
vyasr wants to merge 1 commit into
NVIDIA:mainfrom
vyasr:codex/reuse-python-test-inputs

Conversation

@vyasr

@vyasr vyasr commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Description

Reuses read-only test data across indexing and reduction tests, avoiding repeated device allocations and conversions while preserving the existing assertions and parameter coverage.

Checklist

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

@vyasr
vyasr requested a review from a team as a code owner September 10, 2026 21:31
@vyasr vyasr added the tests Unit testing for project label Sep 10, 2026
@vyasr
vyasr requested a review from bdice September 10, 2026 21:31
@vyasr vyasr added Python Affects Python cuDF API. Performance Performance related issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Sep 10, 2026
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview 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: 75675ee1-d069-4322-a679-833e67cd5bdd

📥 Commits

Reviewing files that changed from the base of the PR and between e78c254 and c2da4d7.

📒 Files selected for processing (5)
  • python/cudf/cudf/tests/dataframe/indexing/test_iloc.py
  • python/cudf/cudf/tests/dataframe/indexing/test_loc.py
  • python/cudf/cudf/tests/dataframe/methods/test_reductions.py
  • python/cudf/cudf/tests/series/indexing/test_iloc.py
  • python/cudf/cudf/tests/series/methods/test_reductions.py

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


📝 Summary

Summary by CodeRabbit

  • Tests
    • Refactored DataFrame and Series indexing tests to reuse shared, validated pandas and cuDF test fixtures.
    • Consolidated reduction-test inputs into reusable fixtures covering nullable integer and floating-point data.
    • Preserved existing indexing assertions, transformations, reduction coverage, and expected-failure handling.

Walkthrough

The tests now use module-scoped fixtures for shared pandas and cuDF indexing and reduction inputs. Reduction tests receive explicit dataset or dtype information from fixture-generated inputs.

Changes

Test fixture refactor

Layer / File(s) Summary
MultiIndex indexing fixtures
python/cudf/cudf/tests/dataframe/indexing/test_iloc.py, python/cudf/cudf/tests/dataframe/indexing/test_loc.py
Added validated shared MultiIndex pandas/cuDF frames and updated .iloc and .loc tests to consume them.
DataFrame reduction fixtures
python/cudf/cudf/tests/dataframe/methods/test_reductions.py
Moved reduction datasets into a fixture that provides dataset IDs and matching pandas/cuDF DataFrames.
Series indexing fixture
python/cudf/cudf/tests/series/indexing/test_iloc.py
Added reusable DataFrame builders and a fixture that provides pandas/cuDF pairs to the .iloc test.
Series reduction fixture
python/cudf/cudf/tests/series/methods/test_reductions.py
Added parametrized nullable numeric Series inputs and updated the reduction test to consume them.

Priority: ⬇️ Low

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

Suggested reviewers: mroeschke, galipremsagar

Merge Risk: ⚪ Minimal · up to c2da4

This change only reorganizes existing test setup code to share read-only test data through fixtures, with no changes to production behavior. Verification confirmed the reduction test's updated expected-failure matching still targets the same cases as before, and the shared fixtures are not mutated by the tests that consume them. This is safe to merge.

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 5 files. 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 summarizes the main change: reusing Python test inputs across indexing and reduction tests.
Description check ✅ Passed The description directly explains the reuse of read-only test data, reduced allocations and conversions, and preservation of test coverage.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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: Todo

Development

Successfully merging this pull request may close these issues.

1 participant