Skip to content

Isolate pandas plotting options between sharded tests - #24069

Open
galipremsagar wants to merge 3 commits into
NVIDIA:mainfrom
galipremsagar:fix-cudf-pandas-plotting-shards
Open

Isolate pandas plotting options between sharded tests#24069
galipremsagar wants to merge 3 commits into
NVIDIA:mainfrom
galipremsagar:fix-cudf-pandas-plotting-shards

Conversation

@galipremsagar

Copy link
Copy Markdown
Contributor

Description

Fix the plotting-state group in NODEIDS_TO_SKIP_WHEN_SHARDED (#22992).

test_xcompat_plot_params leaves the public pandas plotting option xaxis.compat enabled. An adjacent test normally resets it, but hashing those tests into different shards separates the mutation and reset. Later time-series plots then take the wrong plotting path. The same minimal polluter/victim pair fails with vanilla pandas, so this is test isolation, not a GPU plotting implementation bug.

Snapshot and restore pandas plotting options around tests using the existing mpl_cleanup fixture, including when a test fails. Remove the 57 shard-only skips reproduced by this leak. Four independent figure-pickling skips are handled separately.

Validation

  • Forced order: polluting test followed by all 61 previously skipped plotting cases, 57 failures / 5 passes before, 62 passes after.
  • Regression tests for cleanup after successful/failed tests, with vanilla pandas and cudf.pandas: 4 passed.
  • Full plotting suite unsharded: 1,210 passed, zero failures.
  • Full plotting suite over both shards with all 61 skips removed: 1,210 passed, zero failures; existing xfails/explicit non-strict xpasses unchanged.
  • Ruff and whitespace checks passed.

Plotting intentionally executes through pandas/Matplotlib. This changes only test-state isolation; disabling CPU fallback is not applicable to this group. Tests used pandas 3.0.3 and local source Python with existing cuDF 26.10 native libraries, plus an external compatibility hook for the exact apply_boolean_maskapply_retention_mask GPU API rename. No installed environment or vendored pandas tests were modified. Matching main native-library validation remains for CI.

Preserve and restore pandas plotting options around matplotlib tests so xaxis.compat changes cannot leak across tests on a shard worker. Remove 57 resulting shard skips and cover cleanup after successful and failed tests under pandas and cudf.pandas.
@galipremsagar
galipremsagar requested a review from a team as a code owner September 9, 2026 17:01
@galipremsagar
galipremsagar requested a review from bdice September 9, 2026 17:01
@copy-pr-bot

copy-pr-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

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 Sep 9, 2026
@coderabbitai

coderabbitai Bot commented Sep 9, 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: 820e94cd-6379-446b-8b91-e48c038afdec

📥 Commits

Reviewing files that changed from the base of the PR and between 310b5be and 1ed0590.

📒 Files selected for processing (2)
  • python/cudf/cudf/pandas/scripts/pandas-testing-plugin.py
  • python/cudf/cudf_pandas_tests/test_pandas_testing_plugin.py

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


📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Plotting settings are now reliably restored between tests, preventing configuration changes from affecting later plotting results.
    • Corrected test coverage for plotting behavior and reduced unnecessary skips for string-extraction scenarios.
  • Tests

    • Added coverage for plotting-option isolation with and without acceleration, including cases where an earlier test fails.

Walkthrough

The pandas testing plugin now restores plotting options after tests that use `mpl_cleanup. New pytester coverage checks isolation across acceleration and failure scenarios. Sharded skip entries are narrowed.

Changes

Plotting isolation

Layer / File(s) Summary
Restore plotting options
python/cudf/cudf/pandas/scripts/pandas-testing-plugin.py, python/cudf/cudf_pandas_tests/test_pandas_testing_plugin.py
An autouse fixture restores pandas.plotting.plot_params after applicable tests. Parametrized subprocess tests cover accelerated and non-accelerated runs, including first-test failures.
Update sharded skip configuration
python/cudf/cudf/pandas/scripts/pandas-testing-plugin.py
The sharded skip list removes four string-extraction entries and retains four pickle-figure plotting entries.

Priority: ⬇️ Low

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

Merge Risk: ⚪ Minimal · up to 0db0d

This change isolates pandas plotting settings between tests and removes obsolete sharded skips. Coverage includes successful and failing tests with and without cudf.pandas acceleration, with no remaining merge-readiness risk identified.

Suggested reviewers: vyasr, 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … 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 concisely describes the main change: isolating pandas plotting options between sharded tests.
Description check ✅ Passed The description directly explains the plotting-state leak, the fixture cleanup, the removed shard-only skips, and the validation results.
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.
Full details: Docstring Coverage

Explanation

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 1 functions across 1 files. (1 skipped: 1 too large.)

✨ 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.

@galipremsagar galipremsagar added bug Something isn't working non-breaking Non-breaking change labels Sep 9, 2026
@galipremsagar

Copy link
Copy Markdown
Contributor Author

/okay to test 4600a37

@galipremsagar

Copy link
Copy Markdown
Contributor Author

/okay to test 0db0dcd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cudf.pandas Issues specific to cudf.pandas non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant