Skip to content

Deprecate legacy output types - #8389

Merged
rapids-bot[bot] merged 9 commits into
NVIDIA:release/26.08from
jcrist:deprecate-legacy-output-types
Jul 22, 2026
Merged

Deprecate legacy output types#8389
rapids-bot[bot] merged 9 commits into
NVIDIA:release/26.08from
jcrist:deprecate-legacy-output-types

Conversation

@jcrist

@jcrist jcrist commented Jul 17, 2026

Copy link
Copy Markdown
Member

This deprecates the 'numba', 'array', 'df_obj', 'dataframe', and 'series' output types.

  • 'numba': numba.cuda itself is being deprecated, and DeviceNDArray is going away. The advice from numba.cuda devs is to stop directly using it.
  • 'array': this is an alias for 'cupy', the user should just use 'cupy'.
  • 'df_obj': this is an alias for 'cudf', the user should just use 'cudf'.
  • 'dataframe' and 'series': these are 'cudf', but with coercion to a specific ndim value (erroring if not possible). This doesn't fit well within the standard sklearn api. If a user wants an output to be specifically a Series or DataFrame, they should handle the coercion themselves later on.

Deprecation warnings are raised:

  • When the user sets a deprecated output_type (either globally, contextually, or on an estimator)
  • OR upon output if the input type is numba and output_type="input". This warns the user that in the future this method will return a cupy array instead, and that they can silence the warning by explicitly setting output_type="cupy" for now.

Additionally, special case handling of numba array inputs in train_test_split is deprecated and will be removed in version 26.10. Users relying on this are warned to coerce their inputs to cupy arrays prior to calling train_test_split.

Fixes #8192.

@jcrist jcrist self-assigned this Jul 17, 2026
@jcrist
jcrist requested a review from a team as a code owner July 17, 2026 01:39
@jcrist jcrist added the improvement Improvement / enhancement to an existing function label Jul 17, 2026
@jcrist
jcrist requested a review from divyegala July 17, 2026 01:39
@jcrist jcrist added the breaking Breaking change label Jul 17, 2026
@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Jul 17, 2026
@jcrist

jcrist commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Opening this now, but it should go in after #8385. I also still need to update all the docstrings to remove mention of the deprecated types.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds deprecation warnings for legacy output types in global and estimator configuration, warns for numba device-array inputs to train_test_split, updates affected tests, and standardizes estimator documentation around supported output types.

Changes

Output type deprecation

Layer / File(s) Summary
Global output type warning configuration
python/cuml/cuml/internals/outputs.py
Adds warnings for deprecated output type aliases when setting the global output type.
Estimator output type deprecation handling
python/cuml/cuml/internals/base.py
Routes estimator assignments through a deprecation-aware descriptor and warns when resolved output is numba.
Numba input deprecation in train_test_split
python/cuml/cuml/model_selection/_split.py, python/cuml/tests/test_train_test_split.py
Warns when train_test_split receives numba device arrays and verifies the warning in fixture coverage.
Warning regression coverage and test inputs
python/cuml/tests/test_*.py
Adds warning assertions and filters for affected tests, adjusts output-type coverage, and changes one SVM test input from numba to cupy.
Supported output type documentation
python/cuml/cuml/**
Updates estimator docstrings to document standardized output type values and removes legacy aliases from the documented options.

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

Suggested reviewers: divyegala, csadorf

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Several copyright/header edits are unrelated to the output-type deprecation work in #8192. Split out or revert the copyright/header-only edits so this PR stays focused on output-type deprecations and related warnings/documentation changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: deprecating legacy output types.
Description check ✅ Passed The description matches the PR scope and explains the deprecation behavior and affected output types.
Linked Issues check ✅ Passed The PR deprecates the listed legacy output types, updates docs, and adds the required numba warnings for estimators and train_test_split.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@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

🤖 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/cuml/cuml/internals/outputs.py`:
- Around line 63-72: Update warn_if_output_type_deprecated so the migration
guidance for “series” and “dataframe” explicitly tells users to coerce the
result to cudf.Series or cudf.DataFrame after switching to output_type='cudf',
while preserving the existing cupy guidance for “numba” and “array”. Update the
warning tests to assert these explicit Series/DataFrame coercion instructions.
🪄 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: 9980aa9a-6446-4512-a268-b57b6f16c87a

📥 Commits

Reviewing files that changed from the base of the PR and between 5d09b57 and 1b84769.

📒 Files selected for processing (6)
  • python/cuml/cuml/internals/base.py
  • python/cuml/cuml/internals/outputs.py
  • python/cuml/tests/test_dataset_generator_types.py
  • python/cuml/tests/test_make_arima.py
  • python/cuml/tests/test_reflection.py
  • python/cuml/tests/test_svm.py

Comment thread python/cuml/cuml/internals/outputs.py
@jcrist
jcrist changed the base branch from main to release/26.08 July 20, 2026 16:53
@jcrist
jcrist force-pushed the deprecate-legacy-output-types branch from 1b84769 to 689c37f Compare July 20, 2026 21:13

@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

🧹 Nitpick comments (1)
python/cuml/tests/test_make_arima.py (1)

43-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the deprecation warning instead of suppressing it.

This filter lets the numba case pass even if the warning regresses or is emitted from an unexpected path. Keep the warning behavior covered by asserting the expected FutureWarning around the numba execution, while leaving other output types unchanged.

Suggested direction
-@pytest.mark.filterwarnings("ignore:`output_type='numba'`:FutureWarning")
 def test_make_arima(...):
     ...

Use pytest.warns(FutureWarning, match="output_type='numba'") conditionally for the numba parameter case.

🤖 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/cuml/tests/test_make_arima.py` at line 43, Replace the filterwarnings
decorator on the test with a conditional pytest.warns assertion around the numba
execution, matching FutureWarning text for output_type='numba'. Leave execution
and warning behavior unchanged for all other output_type parameter cases.
🤖 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/cuml/cuml/internals/outputs.py`:
- Around line 72-77: Update the deprecation warning in
python/cuml/cuml/internals/outputs.py at lines 72-77 to pass an appropriate
stacklevel that points to the user call site, and apply the same correction to
the warning in python/cuml/cuml/internals/base.py at lines 258-265. Adjust only
the warning calls, preserving their existing messages and behavior.

---

Nitpick comments:
In `@python/cuml/tests/test_make_arima.py`:
- Line 43: Replace the filterwarnings decorator on the test with a conditional
pytest.warns assertion around the numba execution, matching FutureWarning text
for output_type='numba'. Leave execution and warning behavior unchanged for all
other output_type parameter 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: ff2fb1ef-757f-4595-a25e-a207062d0457

📥 Commits

Reviewing files that changed from the base of the PR and between 1b84769 and 689c37f.

📒 Files selected for processing (6)
  • python/cuml/cuml/internals/base.py
  • python/cuml/cuml/internals/outputs.py
  • python/cuml/tests/test_dataset_generator_types.py
  • python/cuml/tests/test_make_arima.py
  • python/cuml/tests/test_reflection.py
  • python/cuml/tests/test_svm.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • python/cuml/tests/test_svm.py
  • python/cuml/tests/test_dataset_generator_types.py
  • python/cuml/tests/test_reflection.py

Comment thread python/cuml/cuml/internals/outputs.py
@jcrist jcrist changed the title [WIP] Deprecate legacy output types Deprecate legacy output types Jul 20, 2026

@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: 2

🤖 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/cuml/cuml/model_selection/_split.py`:
- Around line 36-38: Update the input description in the relevant splitter
docstring to explicitly identify numba device arrays as deprecated inputs
accepted through CuPy conversion and slated for removal, or narrow the generic
array-like wording so it does not imply they are fully supported.
- Around line 117-123: Update the deprecation warning in the train_test_split
input-type handling block to pass stacklevel=2 to warnings.warn, so the warning
points to the caller’s call site instead of the internal helper.
🪄 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: 431105cd-895c-457a-b83c-945fc2b5357e

📥 Commits

Reviewing files that changed from the base of the PR and between 1834bef and 2dfa292.

📒 Files selected for processing (2)
  • python/cuml/cuml/model_selection/_split.py
  • python/cuml/tests/test_train_test_split.py

Comment thread python/cuml/cuml/model_selection/_split.py
Comment thread python/cuml/cuml/model_selection/_split.py

@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

🤖 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/cuml/tests/test_compose.py`:
- Around line 34-36: Remove the module-wide pytestmark warning filters from
python/cuml/tests/test_compose.py (lines 34-36) and
python/cuml/tests/test_preprocessing.py (lines 75-77), then apply the same
FutureWarning suppression only to the specific tests that exercise
output_type='numba'.
🪄 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: 1f35467e-d72f-4479-baf6-c48d13d6e6d0

📥 Commits

Reviewing files that changed from the base of the PR and between 2dfa292 and a3b0f59.

📒 Files selected for processing (3)
  • python/cuml/tests/dask/test_dask_global_settings.py
  • python/cuml/tests/test_compose.py
  • python/cuml/tests/test_preprocessing.py

Comment thread python/cuml/tests/test_compose.py
Comment thread python/cuml/cuml/tsa/auto_arima.pyx
jcrist added 7 commits July 22, 2026 14:34
This deprecates the 'numba', 'array', 'df_obj', 'dataframe', and
'series' output types.

- 'numba': `numba.cuda` itself is being deprecated, and `DeviceNDArray`
  is going away. The advice from `numba.cuda` devs is to stop directly
  using it.
- 'array': this is an alias for 'cupy', the user should just use 'cupy'.
- 'df_obj': this is an alias for 'cudf', the user should just use
  'cudf'.
- 'dataframe' and 'series': these are 'cudf', but with coercion to a
  specific ndim value (erroring if not possible). This doesn't fit well
  within the standard sklearn api. If a user wants an output to be
  specifically a Series or DataFrame, they should handle the coercion
  themselves later on.
@jcrist
jcrist force-pushed the deprecate-legacy-output-types branch from dcfc59a to d1d38a8 Compare July 22, 2026 19:34
@jcrist
jcrist requested a review from a team as a code owner July 22, 2026 19:34
@jcrist
jcrist requested a review from gforsyth July 22, 2026 19:34
jcrist added 2 commits July 22, 2026 15:28
Doesn't actually make sense to compare distances if indices are
shuffled, since distances would likewise be shuffled. Just compare
indices.
@jcrist

jcrist commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit d6c939a into NVIDIA:release/26.08 Jul 22, 2026
102 checks passed
@jcrist
jcrist deleted the deprecate-legacy-output-types branch July 22, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate legacy output types

6 participants