diff --git a/python/cuml/internals/import_utils.py b/python/cuml/internals/import_utils.py index 4a7c6324c8..9629ae812f 100644 --- a/python/cuml/internals/import_utils.py +++ b/python/cuml/internals/import_utils.py @@ -17,7 +17,7 @@ import platform from cuml.internals.safe_imports import gpu_only_import, UnavailableError -from distutils.version import LooseVersion +from packaging.version import Version numba = gpu_only_import("numba") @@ -123,14 +123,14 @@ def check_min_dask_version(version): try: import dask - return LooseVersion(dask.__version__) >= LooseVersion(version) + return Version(dask.__version__) >= Version(version) except ImportError: return False def check_min_numba_version(version): try: - return LooseVersion(str(numba.__version__)) >= LooseVersion(version) + return Version(str(numba.__version__)) >= Version(version) except UnavailableError: return False @@ -139,7 +139,7 @@ def check_min_cupy_version(version): if has_cupy(): import cupy - return LooseVersion(str(cupy.__version__)) >= LooseVersion(version) + return Version(str(cupy.__version__)) >= Version(version) else: return False @@ -186,7 +186,7 @@ def has_shap(min_version="0.37"): if min_version is None: return True else: - return LooseVersion(str(shap.__version__)) >= LooseVersion( + return Version(str(shap.__version__)) >= Version( min_version ) except ImportError: @@ -200,7 +200,7 @@ def has_daskglm(min_version=None): if min_version is None: return True else: - return LooseVersion(str(dask_glm.__version__)) >= LooseVersion( + return Version(str(dask_glm.__version__)) >= Version( min_version ) except ImportError: diff --git a/python/cuml/tests/dask/test_dask_one_hot_encoder.py b/python/cuml/tests/dask/test_dask_one_hot_encoder.py index e4d76bd470..ca933c45f7 100644 --- a/python/cuml/tests/dask/test_dask_one_hot_encoder.py +++ b/python/cuml/tests/dask/test_dask_one_hot_encoder.py @@ -42,7 +42,7 @@ def test_onehot_vs_skonehot(client): X = dask_cudf.from_cudf(X, npartitions=2) enc = OneHotEncoder(sparse=False) - skohe = SkOneHotEncoder(sparse=False) + skohe = SkOneHotEncoder(sparse_output=False) ohe = enc.fit_transform(X) ref = skohe.fit_transform(skX) @@ -141,7 +141,7 @@ def test_onehot_random_inputs(client, drop, as_array, sparse, n_samples): dX = dask_cudf.from_cudf(X, npartitions=1) enc = OneHotEncoder(sparse=sparse, drop=drop, categories="auto") - sk_enc = SkOneHotEncoder(sparse=sparse, drop=drop, categories="auto") + sk_enc = SkOneHotEncoder(sparse_output=sparse, drop=drop, categories="auto") ohe = enc.fit_transform(dX) ref = sk_enc.fit_transform(ary) if sparse: @@ -160,7 +160,7 @@ def test_onehot_drop_idx_first(client): ddf = dask_cudf.from_cudf(X, npartitions=2) enc = OneHotEncoder(sparse=False, drop="first") - sk_enc = SkOneHotEncoder(sparse=False, drop="first") + sk_enc = SkOneHotEncoder(sparse_output=False, drop="first") ohe = enc.fit_transform(ddf) ref = sk_enc.fit_transform(X_ary) cp.testing.assert_array_equal(ohe.compute(), ref) @@ -178,7 +178,7 @@ def test_onehot_drop_one_of_each(client): drop = dict({"chars": "b", "int": 2, "letters": "b"}) enc = OneHotEncoder(sparse=False, drop=drop) - sk_enc = SkOneHotEncoder(sparse=False, drop=["b", 2, "b"]) + sk_enc = SkOneHotEncoder(sparse_output=False, drop=["b", 2, "b"]) ohe = enc.fit_transform(ddf) ref = sk_enc.fit_transform(X_ary) cp.testing.assert_array_equal(ohe.compute(), ref) diff --git a/python/cuml/tests/dask/test_dask_serialization.py b/python/cuml/tests/dask/test_dask_serialization.py index 2eb9a35060..b5620184d2 100644 --- a/python/cuml/tests/dask/test_dask_serialization.py +++ b/python/cuml/tests/dask/test_dask_serialization.py @@ -73,7 +73,7 @@ def test_serialize_mnmg_model(client): X, y = make_regression(n_samples=1000, n_features=20, random_state=0) X, y = da.from_array(X), da.from_array(y) - model = LinearRegression(client) + model = LinearRegression(client=client) model.fit(X, y) pickled_model = pickle.dumps(model) diff --git a/python/pyproject.toml b/python/pyproject.toml index cfada5541a..e7aadb97e0 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -38,7 +38,8 @@ markers = [ testpaths = "cuml/tests" filterwarnings = [ - "error::FutureWarning:cuml[.*]", # Catch uses of deprecated positional args in testing + "error::FutureWarning", + "error::DeprecationWarning", "error:::cudf", "ignore:[^.]*ABCs[^.]*:DeprecationWarning:patsy[.*]", "ignore:(.*)alias(.*):DeprecationWarning:hdbscan[.*]",