Skip to content

Remove the deprecated convert_dtype kwarg - #8436

Merged
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
jcrist:remove-convert-dtype
Aug 3, 2026
Merged

Remove the deprecated convert_dtype kwarg#8436
rapids-bot[bot] merged 2 commits into
NVIDIA:mainfrom
jcrist:remove-convert-dtype

Conversation

@jcrist

@jcrist jcrist commented Aug 3, 2026

Copy link
Copy Markdown
Member

This removes the deprecated convert_dtype kwarg everywhere.

Part of #8225.

This removes the deprecated `convert_dtype` kwarg everywhere.
@jcrist jcrist self-assigned this Aug 3, 2026
@jcrist
jcrist requested a review from a team as a code owner August 3, 2026 20:14
@jcrist
jcrist requested a review from divyegala August 3, 2026 20:14
@jcrist jcrist added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Aug 3, 2026
@github-actions github-actions Bot added the Cython / Python Cython or Python issue label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 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: 47e04ab8-fba8-4a3a-8e30-185e086c4434

📥 Commits

Reviewing files that changed from the base of the PR and between 2af86c9 and 6f4beb8.

📒 Files selected for processing (2)
  • wiki/python/DEVELOPER_GUIDE.md
  • wiki/python/ESTIMATOR_GUIDE.md

📝 Walkthrough

Summary by CodeRabbit

  • Breaking Changes

    • Removed the deprecated convert_dtype option from public clustering, decomposition, estimator, metric, neighbor, time-series, and other APIs.
    • Simplified distributed and single-device method signatures.
  • Behavior Updates

    • Input validation now consistently applies supported dtype conversion without a conversion-control option.
    • Training, prediction, scoring, and transformation behavior remains unchanged.
  • Documentation

    • Removed references to the retired option and refreshed copyright notices.

Walkthrough

Changes

convert_dtype API removal

Layer / File(s) Summary
Validation contract and documentation
python/cuml/cuml/internals/validation.py, python/cuml/cuml/common/doc_utils.py, python/cuml/tests/test_validation.py, wiki/python/*
Validation helpers, generated documentation, tests, and guides no longer use convert_dtype. Dtype mismatches now select the first requested dtype.
Estimator and transformer APIs
python/cuml/cuml/cluster/*, python/cuml/cuml/decomposition/*, python/cuml/cuml/manifold/*, python/cuml/cuml/random_projection/*, python/cuml/cuml/covariance/*
Estimator signatures and internal validation calls no longer accept or forward convert_dtype.
Distributed and neighbor APIs
python/cuml/cuml/dask/*, python/cuml/cuml/neighbors/*
Distributed task dispatch and neighbor prediction helpers no longer pass convert_dtype.
Supervised models and solvers
python/cuml/cuml/ensemble/*, python/cuml/cuml/linear_model/*, python/cuml/cuml/solvers/*, python/cuml/cuml/svm/*, python/cuml/cuml/kernel_ridge/*
Training, prediction, scoring, and solver interfaces remove convert_dtype while retaining other validation options.
Metrics, explainers, and time series
python/cuml/cuml/metrics/*, python/cuml/cuml/explainer/*, python/cuml/cuml/naive_bayes/*, python/cuml/cuml/tsa/*
Public functions and internal call chains remove convert_dtype; affected copyright notices are updated.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: divyegala, dantegd, viclafargue

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the removal of the deprecated convert_dtype keyword argument throughout the codebase.
Description check ✅ Passed The description directly states that the deprecated convert_dtype keyword argument is removed and references the related issue.
Docstring Coverage ✅ Passed Docstring coverage is 80.95% which is sufficient. The required threshold is 80.00%.
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.
✨ 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.

Caution

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

⚠️ Outside diff range comments (1)
python/cuml/cuml/solvers/sgd.pyx (1)

99-104: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove the stale convert_to_dtype entry from the fit_sgd docstring.

The fit_sgd signature no longer accepts this keyword, but the docstring still documents it at Line [129]. A caller that follows the docstring gets an unexpected-keyword error. Delete the two-line entry.

Proposed fix
-    convert_to_dtype : bool, default=True
-        When set to True, will convert array inputs to be of the proper dtypes.

Based on learnings, fit_sgd is an internal solver helper, so this finding is a documentation-contract defect rather than a required public deprecation period.

Also applies to: 129-130

🤖 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/cuml/solvers/sgd.pyx` around lines 99 - 104, Remove the stale
two-line convert_to_dtype parameter entry from the fit_sgd docstring, leaving
the documentation consistent with the current fit_sgd signature and all
remaining parameter descriptions unchanged.

Source: Learnings

🧹 Nitpick comments (1)
python/cuml/cuml/dask/neighbors/kneighbors_regressor.py (1)

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

Align the helper parameter names with the worker API.

The task submission supplies self.n_outputs at Line [195] and the worker rank at Line [196]. The worker method uses n_outputs at Line [57] and rank at Line [58] in python/cuml/cuml/neighbors/kneighbors_regressor_mg.pyx.

The current values arrive correctly only because _func_predict names the arguments in reverse. Rename the helper parameters to n_outputs, rank. This prevents a future positional-argument regression.

Suggested parameter-order cleanup
 def _func_predict(
     model,
     index,
     index_parts_to_ranks,
     index_nrows,
     query,
     query_parts_to_ranks,
     query_nrows,
     ncols,
-    rank,
-    n_output,
+    n_outputs,
+    rank,
 ):
     return model.predict(
         index,
         index_parts_to_ranks,
         index_nrows,
         query,
         query_parts_to_ranks,
         query_nrows,
         ncols,
-        rank,
-        n_output,
+        n_outputs,
+        rank,
     )

Also applies to: 194-197

🤖 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/cuml/dask/neighbors/kneighbors_regressor.py` around lines 99 -
110, Rename the corresponding parameters of the _func_predict helper to
n_outputs and rank, matching the worker API and the positional arguments
supplied by the task submission. Update the helper’s model.predict invocation to
pass these renamed parameters in the existing API order, without changing other
behavior.
🤖 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.

Outside diff comments:
In `@python/cuml/cuml/solvers/sgd.pyx`:
- Around line 99-104: Remove the stale two-line convert_to_dtype parameter entry
from the fit_sgd docstring, leaving the documentation consistent with the
current fit_sgd signature and all remaining parameter descriptions unchanged.

---

Nitpick comments:
In `@python/cuml/cuml/dask/neighbors/kneighbors_regressor.py`:
- Around line 99-110: Rename the corresponding parameters of the _func_predict
helper to n_outputs and rank, matching the worker API and the positional
arguments supplied by the task submission. Update the helper’s model.predict
invocation to pass these renamed parameters in the existing API order, without
changing other behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9a2fd106-22af-4253-b95c-d22a6fb73ad0

📥 Commits

Reviewing files that changed from the base of the PR and between 56c9072 and 2af86c9.

📒 Files selected for processing (62)
  • python/cuml/cuml/cluster/agglomerative.pyx
  • python/cuml/cuml/cluster/dbscan.pyx
  • python/cuml/cuml/cluster/hdbscan/hdbscan.pyx
  • python/cuml/cuml/cluster/kmeans.pyx
  • python/cuml/cuml/common/doc_utils.py
  • python/cuml/cuml/covariance/empirical_covariance.py
  • python/cuml/cuml/covariance/ledoit_wolf.py
  • python/cuml/cuml/dask/ensemble/base.py
  • python/cuml/cuml/dask/ensemble/randomforestclassifier.py
  • python/cuml/cuml/dask/ensemble/randomforestregressor.py
  • python/cuml/cuml/dask/manifold/umap.py
  • python/cuml/cuml/dask/neighbors/kneighbors_classifier.py
  • python/cuml/cuml/dask/neighbors/kneighbors_regressor.py
  • python/cuml/cuml/dask/neighbors/nearest_neighbors.py
  • python/cuml/cuml/decomposition/incremental_pca.py
  • python/cuml/cuml/decomposition/pca.pyx
  • python/cuml/cuml/decomposition/tsvd.pyx
  • python/cuml/cuml/ensemble/randomforestclassifier.py
  • python/cuml/cuml/ensemble/randomforestregressor.py
  • python/cuml/cuml/explainer/tree_shap.pyx
  • python/cuml/cuml/internals/validation.py
  • python/cuml/cuml/kernel_ridge/kernel_ridge.py
  • python/cuml/cuml/linear_model/base.py
  • python/cuml/cuml/linear_model/elastic_net.py
  • python/cuml/cuml/linear_model/lars.pyx
  • python/cuml/cuml/linear_model/linear_regression.pyx
  • python/cuml/cuml/linear_model/logistic_regression.py
  • python/cuml/cuml/linear_model/mbsgd_classifier.py
  • python/cuml/cuml/linear_model/mbsgd_regressor.py
  • python/cuml/cuml/linear_model/ridge.pyx
  • python/cuml/cuml/manifold/t_sne.pyx
  • python/cuml/cuml/manifold/umap/umap.pyx
  • python/cuml/cuml/metrics/cluster/adjusted_rand_index.pyx
  • python/cuml/cuml/metrics/cluster/silhouette_score.pyx
  • python/cuml/cuml/metrics/confusion_matrix.py
  • python/cuml/cuml/metrics/kl_divergence.pyx
  • python/cuml/cuml/metrics/pairwise_distances.pyx
  • python/cuml/cuml/metrics/pairwise_kernels.py
  • python/cuml/cuml/metrics/trustworthiness.pyx
  • python/cuml/cuml/naive_bayes/naive_bayes.py
  • python/cuml/cuml/neighbors/kernel_density.pyx
  • python/cuml/cuml/neighbors/kneighbors_classifier.pyx
  • python/cuml/cuml/neighbors/kneighbors_classifier_mg.pyx
  • python/cuml/cuml/neighbors/kneighbors_regressor.pyx
  • python/cuml/cuml/neighbors/kneighbors_regressor_mg.pyx
  • python/cuml/cuml/neighbors/nearest_neighbors.pyx
  • python/cuml/cuml/neighbors/nearest_neighbors_mg.pyx
  • python/cuml/cuml/random_projection/random_projection.py
  • python/cuml/cuml/solvers/cd.pyx
  • python/cuml/cuml/solvers/qn.pyx
  • python/cuml/cuml/solvers/sgd.pyx
  • python/cuml/cuml/svm/linear.pyx
  • python/cuml/cuml/svm/linear_svc.py
  • python/cuml/cuml/svm/linear_svr.py
  • python/cuml/cuml/svm/svc.py
  • python/cuml/cuml/svm/svm_base.pyx
  • python/cuml/cuml/svm/svr.py
  • python/cuml/cuml/tsa/arima.pyx
  • python/cuml/cuml/tsa/auto_arima.pyx
  • python/cuml/cuml/tsa/seasonality.py
  • python/cuml/cuml/tsa/stationarity.pyx
  • python/cuml/tests/test_validation.py
💤 Files with no reviewable changes (2)
  • python/cuml/cuml/metrics/pairwise_kernels.py
  • python/cuml/cuml/tsa/stationarity.pyx

@csadorf csadorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please also remove the related guidance from wiki/python/DEVELOPER_GUIDE.md and wiki/python/ESTIMATOR_GUIDE.md.

@jcrist

jcrist commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

Done.

@csadorf csadorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you! :shipit:

@jcrist

jcrist commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit 0277bdf into NVIDIA:main Aug 3, 2026
189 of 191 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cython / Python Cython or Python issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants