diff --git a/python-package/xgboost/data.py b/python-package/xgboost/data.py index dbe0a66c8..99e0c2219 100644 --- a/python-package/xgboost/data.py +++ b/python-package/xgboost/data.py @@ -749,8 +749,9 @@ def _is_cudf_ser(data: DataType) -> bool: def _is_cupy_array(data: DataType) -> bool: - return lazy_isinstance(data, "cupy.core.core", "ndarray") or lazy_isinstance( - data, "cupy._core.core", "ndarray" + return any( + lazy_isinstance(data, n, "ndarray") + for n in ("cupy.core.core", "cupy", "cupy._core.core") ) diff --git a/tests/ci_build/conda_env/python_lint.yml b/tests/ci_build/conda_env/python_lint.yml index f1f877d52..38188a1b6 100644 --- a/tests/ci_build/conda_env/python_lint.yml +++ b/tests/ci_build/conda_env/python_lint.yml @@ -6,7 +6,7 @@ dependencies: - pylint - wheel - setuptools -- mypy +- mypy=0.961 - numpy - scipy - pandas