Skip to content

Remove deprecated .values_host property in cudf - #22649

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
mroeschke:cudf/rm/values_host
May 23, 2026
Merged

Remove deprecated .values_host property in cudf#22649
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
mroeschke:cudf/rm/values_host

Conversation

@mroeschke

Copy link
Copy Markdown
Contributor

Description

Deprecated in 26.04

Checklist

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

@mroeschke mroeschke self-assigned this May 22, 2026
@mroeschke mroeschke added the improvement Improvement / enhancement to an existing function label May 22, 2026
@mroeschke
mroeschke requested a review from a team as a code owner May 22, 2026 21:18
@mroeschke mroeschke added the breaking Breaking change label May 22, 2026
@mroeschke
mroeschke requested review from bdice and rjzamora May 22, 2026 21:18
@github-actions github-actions Bot added the Python Affects Python cuDF API. label May 22, 2026
@GPUtester GPUtester moved this to In Progress in cuDF Python May 22, 2026
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Refactor

    • Removed deprecated values_host property from DataFrame, Index, Series, and MultiIndex classes.
  • Documentation

    • Updated API documentation and developer guides to reflect property removal.
  • Tests

    • Enhanced test coverage for array conversion methods and updated related tests.

Walkthrough

The PR removes the deprecated values_host property from cuDF's core classes and refactors tests to verify to_numpy() as the standard API for numpy array conversion. Changes span implementation, API documentation, benchmarks, and test suites across DataFrame, Index, RangeIndex, MultiIndex, ColumnBase, and SingleColumnFrame.

Changes

Deprecation Removal: values_host → to_numpy()

Layer / File(s) Summary
Core API implementation cleanup
python/cudf/cudf/core/column/column.py, python/cudf/cudf/core/frame.py, python/cudf/cudf/core/index.py, python/cudf/cudf/core/multiindex.py, python/cudf/cudf/core/single_column_frame.py
Deprecated values_host properties are removed from ColumnBase, Frame, RangeIndex, MultiIndex, and SingleColumnFrame; to_numpy() docstrings are added/updated; MultiIndex imports refactored to replace warnings with cached_property.
Public API documentation updates
docs/cudf/source/cudf/api_docs/dataframe.rst, docs/cudf/source/cudf/api_docs/index_objects.rst, docs/cudf/source/cudf/api_docs/series.rst, docs/cudf/source/cudf/developer_guide/library_design.md
Removed values_host autosummary entries from DataFrame, Index, and Series API documentation; removed device-to-host implementation note from developer guide.
Benchmark refactoring
python/cudf/benchmarks/API/bench_frame_or_index.py, python/cudf/benchmarks/API/bench_rangeindex.py
Removed bench_values_host benchmarks; introduced bench_values targeting .values property without pandas_incompatible marker.
New to_numpy test verification
python/cudf/cudf/tests/indexes/index/methods/test_to_numpy.py, python/cudf/cudf/tests/indexes/multiindex/methods/test_to_numpy.py, python/cudf/cudf/tests/series/methods/test_to_numpy.py
Added parametrized tests for Index, MultiIndex, and Series to_numpy() output matching pandas .values across supported dtypes and data shapes.
Test attribute suite migration
python/cudf/cudf/tests/indexes/index/test_attributes.py, python/cudf/cudf/tests/indexes/multiindex/test_attributes.py, python/cudf/cudf/tests/series/test_attributes.py
Removed old test_*_values_host tests; added/updated test_*_values tests targeting .values property; marked categorical/string cases as xfail with expected exception types.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • rapidsai/cudf#22518: Related PR with corresponding test refactoring for Index values_host deprecation and to_numpy() verification patterns.

Suggested labels

Python, doc

Suggested reviewers

  • vyasr
  • mythrocks
  • bdice
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% 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 accurately summarizes the main change: removal of the deprecated .values_host property across the codebase.
Description check ✅ Passed The description is related to the changeset, noting that the .values_host property was deprecated in 26.04 and is being removed.
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.

✏️ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
python/cudf/cudf/tests/indexes/multiindex/methods/test_to_numpy.py (1)

8-17: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add edge-path cases for MultiIndex.to_numpy().

Please add empty and null-containing MultiIndex cases here; the current test only validates one nominal input.

As per coding guidelines python/**/test_*.py: Ensure test files provide comprehensive edge case coverage (empty, all-null, single-element, mixed types) and do not depend on external datasets.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/cudf/cudf/tests/indexes/multiindex/methods/test_to_numpy.py` around
lines 8 - 17, The test_multiindex_to_numpy currently only checks a single
nominal MultiIndex; add additional edge-path cases to cover empty, all-null, and
single-element/mixed-type MultiIndex inputs for MultiIndex.to_numpy(). Create
new MultiIndex instances using cudf.MultiIndex (e.g., an empty MultiIndex with
empty levels/codes, a MultiIndex where codes contain -1/null positions to
produce null entries, and small single-element or mixed-type levels), convert
each to pandas via .to_pandas() and compare midx.to_numpy() with pmidx.values
using assert_eq to validate behavior across those edge cases.
python/cudf/cudf/tests/indexes/index/methods/test_to_numpy.py (1)

11-17: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Expand edge-case coverage for Index.to_numpy() tests.

Current parametrization only covers empty and single-element inputs; please add explicit all-null and mixed-type cases in this module to match the test coverage standard.

As per coding guidelines python/**/test_*.py: Ensure test files provide comprehensive edge case coverage (empty, all-null, single-element, mixed types) and do not depend on external datasets.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/cudf/cudf/tests/indexes/index/methods/test_to_numpy.py` around lines
11 - 17, Update the test_index_to_numpy parametrization to include explicit
all-null and mixed-type inputs so edge cases are covered: add cases like a
multi-null list (e.g., [None, None]) to validate all-null behavior and a mixed
list (e.g., [1, None] or ["a", 1]) to validate mixed-type handling; in the
test_index_to_numpy function use the existing cudf.Index (gdi) and pd.Index
(pdi) construction with the same dtype parameter (all_supported_types_as_str)
and assert equality via np.testing.assert_array_equal(gdi.to_numpy(),
pdi.values) for those new inputs as well, ensuring mixed-type cases use an
appropriate dtype (e.g., object) if needed so pandas and cudf Index creation
succeed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@python/cudf/cudf/tests/series/methods/test_to_numpy.py`:
- Around line 39-53: Add explicit all-null and single-element cases to the
test_series_to_numpy parametrization so the test covers empty, all-null,
single-element and mixed inputs. Modify the "data" list in test_series_to_numpy
to include an all-null case (e.g., [None, None] or [np.nan, np.nan]) and a
single-element case (e.g., [1] or ["x"]) alongside the existing examples,
keeping the existing dtype logic (None if data else float) and the asserts that
compare pds.values to gds.to_numpy().

---

Outside diff comments:
In `@python/cudf/cudf/tests/indexes/index/methods/test_to_numpy.py`:
- Around line 11-17: Update the test_index_to_numpy parametrization to include
explicit all-null and mixed-type inputs so edge cases are covered: add cases
like a multi-null list (e.g., [None, None]) to validate all-null behavior and a
mixed list (e.g., [1, None] or ["a", 1]) to validate mixed-type handling; in the
test_index_to_numpy function use the existing cudf.Index (gdi) and pd.Index
(pdi) construction with the same dtype parameter (all_supported_types_as_str)
and assert equality via np.testing.assert_array_equal(gdi.to_numpy(),
pdi.values) for those new inputs as well, ensuring mixed-type cases use an
appropriate dtype (e.g., object) if needed so pandas and cudf Index creation
succeed.

In `@python/cudf/cudf/tests/indexes/multiindex/methods/test_to_numpy.py`:
- Around line 8-17: The test_multiindex_to_numpy currently only checks a single
nominal MultiIndex; add additional edge-path cases to cover empty, all-null, and
single-element/mixed-type MultiIndex inputs for MultiIndex.to_numpy(). Create
new MultiIndex instances using cudf.MultiIndex (e.g., an empty MultiIndex with
empty levels/codes, a MultiIndex where codes contain -1/null positions to
produce null entries, and small single-element or mixed-type levels), convert
each to pandas via .to_pandas() and compare midx.to_numpy() with pmidx.values
using assert_eq to validate behavior across those edge cases.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b3cc4c01-2f26-46f2-841f-f496384846fc

📥 Commits

Reviewing files that changed from the base of the PR and between 3cfe15b and 09c1529.

📒 Files selected for processing (17)
  • docs/cudf/source/cudf/api_docs/dataframe.rst
  • docs/cudf/source/cudf/api_docs/index_objects.rst
  • docs/cudf/source/cudf/api_docs/series.rst
  • docs/cudf/source/cudf/developer_guide/library_design.md
  • python/cudf/benchmarks/API/bench_frame_or_index.py
  • python/cudf/benchmarks/API/bench_rangeindex.py
  • python/cudf/cudf/core/column/column.py
  • python/cudf/cudf/core/frame.py
  • python/cudf/cudf/core/index.py
  • python/cudf/cudf/core/multiindex.py
  • python/cudf/cudf/core/single_column_frame.py
  • python/cudf/cudf/tests/indexes/index/methods/test_to_numpy.py
  • python/cudf/cudf/tests/indexes/index/test_attributes.py
  • python/cudf/cudf/tests/indexes/multiindex/methods/test_to_numpy.py
  • python/cudf/cudf/tests/indexes/multiindex/test_attributes.py
  • python/cudf/cudf/tests/series/methods/test_to_numpy.py
  • python/cudf/cudf/tests/series/test_attributes.py
💤 Files with no reviewable changes (11)
  • docs/cudf/source/cudf/api_docs/series.rst
  • docs/cudf/source/cudf/api_docs/dataframe.rst
  • docs/cudf/source/cudf/api_docs/index_objects.rst
  • python/cudf/benchmarks/API/bench_rangeindex.py
  • python/cudf/cudf/core/column/column.py
  • python/cudf/benchmarks/API/bench_frame_or_index.py
  • python/cudf/cudf/tests/indexes/multiindex/test_attributes.py
  • python/cudf/cudf/core/frame.py
  • python/cudf/cudf/tests/series/test_attributes.py
  • python/cudf/cudf/tests/indexes/index/test_attributes.py
  • python/cudf/cudf/core/single_column_frame.py

Comment thread python/cudf/cudf/tests/series/methods/test_to_numpy.py
@mroeschke

Copy link
Copy Markdown
Contributor Author

/merge

@rapids-bot
rapids-bot Bot merged commit 9223a6b into NVIDIA:main May 23, 2026
109 of 113 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in cuDF Python May 23, 2026
@mroeschke
mroeschke deleted the cudf/rm/values_host branch May 23, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change improvement Improvement / enhancement to an existing function Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants