diff --git a/demo/dask/cpu_survival.py b/demo/dask/cpu_survival.py index 629667b1283f..83eddd361a29 100644 --- a/demo/dask/cpu_survival.py +++ b/demo/dask/cpu_survival.py @@ -8,9 +8,9 @@ import dask.dataframe as dd from dask.distributed import Client, LocalCluster -from xgboost.dask import DaskDMatrix import xgboost as xgb +from xgboost.dask import DaskDMatrix def main(client): diff --git a/demo/dask/cpu_training.py b/demo/dask/cpu_training.py index 7fc5d2d1c859..a31e5d2a626d 100644 --- a/demo/dask/cpu_training.py +++ b/demo/dask/cpu_training.py @@ -5,9 +5,9 @@ """ from dask import array as da from dask.distributed import Client, LocalCluster -from xgboost.dask import DaskDMatrix import xgboost as xgb +from xgboost.dask import DaskDMatrix def main(client): diff --git a/demo/dask/dask_callbacks.py b/demo/dask/dask_callbacks.py index a80ede01f1cb..408297d9e2f2 100644 --- a/demo/dask/dask_callbacks.py +++ b/demo/dask/dask_callbacks.py @@ -6,9 +6,9 @@ from dask.distributed import Client, LocalCluster from dask_ml.datasets import make_regression from dask_ml.model_selection import train_test_split -from xgboost.dask import DaskDMatrix import xgboost as xgb +from xgboost.dask import DaskDMatrix def probability_for_going_backward(epoch): diff --git a/demo/dask/gpu_training.py b/demo/dask/gpu_training.py index cf09f8e44c5e..23cbfb47c7e2 100644 --- a/demo/dask/gpu_training.py +++ b/demo/dask/gpu_training.py @@ -7,10 +7,10 @@ from dask import dataframe as dd from dask.distributed import Client from dask_cuda import LocalCUDACluster -from xgboost.dask import DaskDMatrix import xgboost as xgb from xgboost import dask as dxgb +from xgboost.dask import DaskDMatrix def using_dask_matrix(client: Client, X, y): diff --git a/demo/guide-python/spark_estimator_examples.py b/demo/guide-python/spark_estimator_examples.py index cbc3862e5913..97caef610642 100644 --- a/demo/guide-python/spark_estimator_examples.py +++ b/demo/guide-python/spark_estimator_examples.py @@ -10,6 +10,7 @@ from pyspark.sql import SparkSession from pyspark.sql.functions import rand from sklearn.model_selection import train_test_split + from xgboost.spark import SparkXGBClassifier, SparkXGBRegressor spark = SparkSession.builder.master("local[*]").getOrCreate() diff --git a/demo/nvflare/custom/controller.py b/demo/nvflare/custom/controller.py index ae2933ad8316..dd3e39f46cf3 100644 --- a/demo/nvflare/custom/controller.py +++ b/demo/nvflare/custom/controller.py @@ -4,7 +4,6 @@ """ import multiprocessing -import xgboost.federated from nvflare.apis.client import Client from nvflare.apis.fl_context import FLContext from nvflare.apis.impl.controller import Controller, Task @@ -12,6 +11,8 @@ from nvflare.apis.signal import Signal from trainer import SupportedTasks +import xgboost.federated + class XGBoostController(Controller): def __init__(self, port: int, world_size: int, server_key_path: str, diff --git a/python-package/xgboost/spark/core.py b/python-package/xgboost/spark/core.py index 8a13e88cc150..745c9348fc9a 100644 --- a/python-package/xgboost/spark/core.py +++ b/python-package/xgboost/spark/core.py @@ -34,12 +34,12 @@ ShortType, ) from scipy.special import expit, softmax # pylint: disable=no-name-in-module -from xgboost.compat import is_cudf_available -from xgboost.core import Booster -from xgboost.training import train as worker_train import xgboost from xgboost import XGBClassifier, XGBRanker, XGBRegressor +from xgboost.compat import is_cudf_available +from xgboost.core import Booster +from xgboost.training import train as worker_train from .data import ( _read_csr_matrix_from_unwrapped_spark_vec, diff --git a/python-package/xgboost/spark/data.py b/python-package/xgboost/spark/data.py index e5a0eac94ea7..6e2d4c6db255 100644 --- a/python-package/xgboost/spark/data.py +++ b/python-package/xgboost/spark/data.py @@ -6,9 +6,9 @@ import numpy as np import pandas as pd from scipy.sparse import csr_matrix -from xgboost.compat import concat from xgboost import DataIter, DMatrix, QuantileDMatrix, XGBModel +from xgboost.compat import concat from .._typing import ArrayLike from ..core import _convert_ntree_limit diff --git a/python-package/xgboost/spark/model.py b/python-package/xgboost/spark/model.py index 6b050a468357..888bc9cc5de9 100644 --- a/python-package/xgboost/spark/model.py +++ b/python-package/xgboost/spark/model.py @@ -8,6 +8,7 @@ from pyspark import SparkFiles, cloudpickle from pyspark.ml.util import DefaultParamsReader, DefaultParamsWriter, MLReader, MLWriter from pyspark.sql import SparkSession + from xgboost.core import Booster from .utils import get_class_name, get_logger diff --git a/python-package/xgboost/spark/utils.py b/python-package/xgboost/spark/utils.py index 189396089394..979c40ea9c1a 100644 --- a/python-package/xgboost/spark/utils.py +++ b/python-package/xgboost/spark/utils.py @@ -8,9 +8,9 @@ import pyspark from pyspark import BarrierTaskContext, SparkContext from pyspark.sql.session import SparkSession -from xgboost.tracker import RabitTracker from xgboost import collective +from xgboost.tracker import RabitTracker def get_class_name(cls: Type) -> str: diff --git a/python-package/xgboost/testing/__init__.py b/python-package/xgboost/testing/__init__.py index 23d1731b0d9c..bb13b5523ed2 100644 --- a/python-package/xgboost/testing/__init__.py +++ b/python-package/xgboost/testing/__init__.py @@ -34,10 +34,10 @@ import numpy as np import pytest from scipy import sparse -from xgboost.core import ArrayLike -from xgboost.sklearn import SklObjective import xgboost as xgb +from xgboost.core import ArrayLike +from xgboost.sklearn import SklObjective hypothesis = pytest.importorskip("hypothesis") diff --git a/python-package/xgboost/testing/dask.py b/python-package/xgboost/testing/dask.py index e1f7142943fa..8b39ba12269a 100644 --- a/python-package/xgboost/testing/dask.py +++ b/python-package/xgboost/testing/dask.py @@ -2,9 +2,9 @@ import numpy as np from dask import array as da from distributed import Client -from xgboost.testing.updater import get_basescore import xgboost as xgb +from xgboost.testing.updater import get_basescore def check_init_estimation_clf(tree_method: str, client: Client) -> None: diff --git a/python-package/xgboost/testing/data.py b/python-package/xgboost/testing/data.py index 791ffd7ec506..4f79d7358e93 100644 --- a/python-package/xgboost/testing/data.py +++ b/python-package/xgboost/testing/data.py @@ -2,6 +2,7 @@ from typing import Any, Generator, Tuple, Union import numpy as np + from xgboost.data import pandas_pyarrow_mapper diff --git a/python-package/xgboost/testing/shared.py b/python-package/xgboost/testing/shared.py index 92c5f1e0d6a7..930873163dbc 100644 --- a/python-package/xgboost/testing/shared.py +++ b/python-package/xgboost/testing/shared.py @@ -8,9 +8,9 @@ from typing import Any, Callable, Dict, Type import numpy as np -from xgboost._typing import ArrayLike import xgboost as xgb +from xgboost._typing import ArrayLike def validate_leaf_output(leaf: np.ndarray, num_parallel_tree: int) -> None: diff --git a/python-package/xgboost/testing/updater.py b/python-package/xgboost/testing/updater.py index 05d620088963..4086f92c8ff2 100644 --- a/python-package/xgboost/testing/updater.py +++ b/python-package/xgboost/testing/updater.py @@ -4,9 +4,9 @@ from typing import Dict import numpy as np -import xgboost.testing as tm import xgboost as xgb +import xgboost.testing as tm def get_basescore(model: xgb.XGBModel) -> float: @@ -78,6 +78,7 @@ def check_quantile_loss(tree_method: str, weighted: bool) -> None: """Test for quantile loss.""" from sklearn.datasets import make_regression from sklearn.metrics import mean_pinball_loss + from xgboost.sklearn import _metric_decorator n_samples = 4096 diff --git a/tests/ci_build/lint_python.py b/tests/ci_build/lint_python.py index f5ac1c1c98f3..b3a06b311ff9 100644 --- a/tests/ci_build/lint_python.py +++ b/tests/ci_build/lint_python.py @@ -3,12 +3,15 @@ import subprocess import sys from multiprocessing import Pool, cpu_count -from typing import Dict, Tuple +from typing import Dict, Optional, Tuple from pylint import epylint from test_utils import PY_PACKAGE, ROOT, cd, print_time, record_time CURDIR = os.path.normpath(os.path.abspath(os.path.dirname(__file__))) +SRCPATH = os.path.normpath( + os.path.join(CURDIR, os.path.pardir, os.path.pardir, "python-package") +) @record_time @@ -29,7 +32,7 @@ def run_black(rel_path: str) -> bool: @record_time def run_isort(rel_path: str) -> bool: - cmd = ["isort", "--check", "--profile=black", rel_path] + cmd = ["isort", f"--src={SRCPATH}", "--profile=black", rel_path] ret = subprocess.run(cmd).returncode if ret != 0: subprocess.run(["isort", "--version"]) diff --git a/tests/python-gpu/test_gpu_data_iterator.py b/tests/python-gpu/test_gpu_data_iterator.py index 23e495bcc250..4325b63086d8 100644 --- a/tests/python-gpu/test_gpu_data_iterator.py +++ b/tests/python-gpu/test_gpu_data_iterator.py @@ -2,6 +2,7 @@ import pytest from hypothesis import given, settings, strategies + from xgboost.testing import no_cupy sys.path.append("tests/python") diff --git a/tests/python-gpu/test_gpu_eval_metrics.py b/tests/python-gpu/test_gpu_eval_metrics.py index 2e3b29f99989..6d16aa44e1d7 100644 --- a/tests/python-gpu/test_gpu_eval_metrics.py +++ b/tests/python-gpu/test_gpu_eval_metrics.py @@ -1,10 +1,10 @@ import sys import pytest -from xgboost.testing.metrics import check_quantile_error import xgboost from xgboost import testing as tm +from xgboost.testing.metrics import check_quantile_error sys.path.append("tests/python") import test_eval_metrics as test_em # noqa diff --git a/tests/python-gpu/test_gpu_prediction.py b/tests/python-gpu/test_gpu_prediction.py index 0391784398dd..c4d9abba5f77 100644 --- a/tests/python-gpu/test_gpu_prediction.py +++ b/tests/python-gpu/test_gpu_prediction.py @@ -3,10 +3,10 @@ import numpy as np import pytest from hypothesis import assume, given, settings, strategies -from xgboost.compat import PANDAS_INSTALLED import xgboost as xgb from xgboost import testing as tm +from xgboost.compat import PANDAS_INSTALLED if PANDAS_INSTALLED: from hypothesis.extra.pandas import column, data_frames, range_indexes diff --git a/tests/python-gpu/test_gpu_updaters.py b/tests/python-gpu/test_gpu_updaters.py index 23b2fdf00083..e6c837f982ce 100644 --- a/tests/python-gpu/test_gpu_updaters.py +++ b/tests/python-gpu/test_gpu_updaters.py @@ -4,11 +4,11 @@ import numpy as np import pytest from hypothesis import assume, given, note, settings, strategies -from xgboost.testing.params import cat_parameter_strategy, hist_parameter_strategy -from xgboost.testing.updater import check_init_estimation, check_quantile_loss import xgboost as xgb from xgboost import testing as tm +from xgboost.testing.params import cat_parameter_strategy, hist_parameter_strategy +from xgboost.testing.updater import check_init_estimation, check_quantile_loss sys.path.append("tests/python") import test_updaters as test_up diff --git a/tests/python-gpu/test_gpu_with_sklearn.py b/tests/python-gpu/test_gpu_with_sklearn.py index f26f70b367f4..c9d3ab4ebff7 100644 --- a/tests/python-gpu/test_gpu_with_sklearn.py +++ b/tests/python-gpu/test_gpu_with_sklearn.py @@ -5,10 +5,10 @@ import numpy as np import pytest -from xgboost.testing.ranking import run_ranking_qid_df import xgboost as xgb from xgboost import testing as tm +from xgboost.testing.ranking import run_ranking_qid_df sys.path.append("tests/python") import test_with_sklearn as twskl # noqa diff --git a/tests/python/test_data_iterator.py b/tests/python/test_data_iterator.py index 4b4258a2139d..0590a4954e60 100644 --- a/tests/python/test_data_iterator.py +++ b/tests/python/test_data_iterator.py @@ -4,11 +4,11 @@ import pytest from hypothesis import given, settings, strategies from scipy.sparse import csr_matrix -from xgboost.data import SingleBatchInternalIter as SingleBatch -from xgboost.testing import IteratorForTest, make_batches, non_increasing import xgboost as xgb from xgboost import testing as tm +from xgboost.data import SingleBatchInternalIter as SingleBatch +from xgboost.testing import IteratorForTest, make_batches, non_increasing pytestmark = tm.timeout(30) diff --git a/tests/python/test_dmatrix.py b/tests/python/test_dmatrix.py index 610a46639928..ef56ff6560c0 100644 --- a/tests/python/test_dmatrix.py +++ b/tests/python/test_dmatrix.py @@ -6,10 +6,10 @@ import scipy.sparse from hypothesis import given, settings, strategies from scipy.sparse import csr_matrix, rand -from xgboost.testing.data import np_dtypes import xgboost as xgb from xgboost import testing as tm +from xgboost.testing.data import np_dtypes rng = np.random.RandomState(1) diff --git a/tests/python/test_early_stopping.py b/tests/python/test_early_stopping.py index 000d5e347edc..47f58cbd69c6 100644 --- a/tests/python/test_early_stopping.py +++ b/tests/python/test_early_stopping.py @@ -1,9 +1,9 @@ import numpy as np import pytest -from xgboost.testing.updater import get_basescore import xgboost as xgb from xgboost import testing as tm +from xgboost.testing.updater import get_basescore rng = np.random.RandomState(1994) diff --git a/tests/python/test_eval_metrics.py b/tests/python/test_eval_metrics.py index 7a243edb9f52..ebd0da144d8d 100644 --- a/tests/python/test_eval_metrics.py +++ b/tests/python/test_eval_metrics.py @@ -1,9 +1,9 @@ import numpy as np import pytest -from xgboost.testing.metrics import check_quantile_error import xgboost as xgb from xgboost import testing as tm +from xgboost.testing.metrics import check_quantile_error rng = np.random.RandomState(1337) diff --git a/tests/python/test_predict.py b/tests/python/test_predict.py index 63c0ff9d753b..cb400df87f20 100644 --- a/tests/python/test_predict.py +++ b/tests/python/test_predict.py @@ -5,11 +5,11 @@ import pandas as pd import pytest from scipy import sparse -from xgboost.testing.data import np_dtypes, pd_dtypes -from xgboost.testing.shared import validate_leaf_output import xgboost as xgb from xgboost import testing as tm +from xgboost.testing.data import np_dtypes, pd_dtypes +from xgboost.testing.shared import validate_leaf_output def run_threaded_predict(X, rows, predict_func): diff --git a/tests/python/test_quantile_dmatrix.py b/tests/python/test_quantile_dmatrix.py index 82815d8830d3..316d0e5f6515 100644 --- a/tests/python/test_quantile_dmatrix.py +++ b/tests/python/test_quantile_dmatrix.py @@ -4,6 +4,8 @@ import pytest from hypothesis import given, settings, strategies from scipy import sparse + +import xgboost as xgb from xgboost.testing import ( IteratorForTest, make_batches, @@ -15,8 +17,6 @@ ) from xgboost.testing.data import np_dtypes -import xgboost as xgb - class TestQuantileDMatrix: def test_basic(self) -> None: diff --git a/tests/python/test_ranking.py b/tests/python/test_ranking.py index 6121a202904c..ccbdeff5dcd3 100644 --- a/tests/python/test_ranking.py +++ b/tests/python/test_ranking.py @@ -6,10 +6,10 @@ import pytest from hypothesis import given, note, settings from scipy.sparse import csr_matrix -from xgboost.testing.params import lambdarank_parameter_strategy import xgboost from xgboost import testing as tm +from xgboost.testing.params import lambdarank_parameter_strategy def test_ranking_with_unweighted_data(): diff --git a/tests/python/test_updaters.py b/tests/python/test_updaters.py index 6ad6e72de2ab..c54fb92675b1 100644 --- a/tests/python/test_updaters.py +++ b/tests/python/test_updaters.py @@ -5,6 +5,9 @@ import numpy as np import pytest from hypothesis import given, note, settings, strategies + +import xgboost as xgb +from xgboost import testing as tm from xgboost.testing.params import ( cat_parameter_strategy, exact_parameter_strategy, @@ -12,9 +15,6 @@ ) from xgboost.testing.updater import check_init_estimation, check_quantile_loss -import xgboost as xgb -from xgboost import testing as tm - def train_result(param, dmat, num_rounds): result = {} diff --git a/tests/python/test_with_pandas.py b/tests/python/test_with_pandas.py index 99b34c336191..e5783b24d333 100644 --- a/tests/python/test_with_pandas.py +++ b/tests/python/test_with_pandas.py @@ -3,10 +3,10 @@ import numpy as np import pytest from test_dmatrix import set_base_margin_info -from xgboost.testing.data import pd_arrow_dtypes, pd_dtypes import xgboost as xgb from xgboost import testing as tm +from xgboost.testing.data import pd_arrow_dtypes, pd_dtypes try: import pandas as pd diff --git a/tests/python/test_with_sklearn.py b/tests/python/test_with_sklearn.py index b905ac78c36b..26e4ad343072 100644 --- a/tests/python/test_with_sklearn.py +++ b/tests/python/test_with_sklearn.py @@ -8,12 +8,12 @@ import numpy as np import pytest from sklearn.utils.estimator_checks import parametrize_with_checks -from xgboost.testing.ranking import run_ranking_qid_df -from xgboost.testing.shared import get_feature_weights, validate_data_initialization -from xgboost.testing.updater import get_basescore import xgboost as xgb from xgboost import testing as tm +from xgboost.testing.ranking import run_ranking_qid_df +from xgboost.testing.shared import get_feature_weights, validate_data_initialization +from xgboost.testing.updater import get_basescore rng = np.random.RandomState(1994) pytestmark = [pytest.mark.skipif(**tm.no_sklearn()), tm.timeout(30)] diff --git a/tests/test_distributed/test_federated/test_federated.py b/tests/test_distributed/test_federated/test_federated.py index a534b81210ce..9b8e559157d9 100644 --- a/tests/test_distributed/test_federated/test_federated.py +++ b/tests/test_distributed/test_federated/test_federated.py @@ -3,9 +3,8 @@ import sys import time -import xgboost.federated - import xgboost as xgb +import xgboost.federated SERVER_KEY = 'server-key.pem' SERVER_CERT = 'server-cert.pem' diff --git a/tests/test_distributed/test_gpu_with_dask/test_gpu_with_dask.py b/tests/test_distributed/test_gpu_with_dask/test_gpu_with_dask.py index cf36e92b2f20..2e3b031c1d4b 100644 --- a/tests/test_distributed/test_gpu_with_dask/test_gpu_with_dask.py +++ b/tests/test_distributed/test_gpu_with_dask/test_gpu_with_dask.py @@ -10,10 +10,10 @@ import pytest from hypothesis import given, note, settings, strategies from hypothesis._settings import duration -from xgboost.testing.params import hist_parameter_strategy import xgboost as xgb from xgboost import testing as tm +from xgboost.testing.params import hist_parameter_strategy pytestmark = [ pytest.mark.skipif(**tm.no_dask()), @@ -42,9 +42,9 @@ from dask import array as da from dask.distributed import Client from dask_cuda import LocalCUDACluster - from xgboost.testing.dask import check_init_estimation from xgboost import dask as dxgb + from xgboost.testing.dask import check_init_estimation except ImportError: pass diff --git a/tests/test_distributed/test_gpu_with_spark/test_gpu_spark.py b/tests/test_distributed/test_gpu_with_spark/test_gpu_spark.py index db0650f09537..1f986f96ea10 100644 --- a/tests/test_distributed/test_gpu_with_spark/test_gpu_spark.py +++ b/tests/test_distributed/test_gpu_with_spark/test_gpu_spark.py @@ -12,6 +12,7 @@ from pyspark.ml.linalg import Vectors from pyspark.ml.tuning import CrossValidator, ParamGridBuilder from pyspark.sql import SparkSession + from xgboost.spark import SparkXGBClassifier, SparkXGBRegressor gpu_discovery_script_path = "tests/test_distributed/test_gpu_with_spark/discover_gpu.sh" diff --git a/tests/test_distributed/test_with_dask/test_with_dask.py b/tests/test_distributed/test_with_dask/test_with_dask.py index ba76c04dbf89..369dcd421757 100644 --- a/tests/test_distributed/test_with_dask/test_with_dask.py +++ b/tests/test_distributed/test_with_dask/test_with_dask.py @@ -21,6 +21,9 @@ import sklearn from hypothesis import HealthCheck, given, note, settings from sklearn.datasets import make_classification, make_regression + +import xgboost as xgb +from xgboost import testing as tm from xgboost.data import _is_cudf_df from xgboost.testing.params import hist_parameter_strategy from xgboost.testing.shared import ( @@ -29,9 +32,6 @@ validate_leaf_output, ) -import xgboost as xgb -from xgboost import testing as tm - pytestmark = [tm.timeout(60), pytest.mark.skipif(**tm.no_dask())] import dask @@ -39,6 +39,7 @@ import dask.dataframe as dd from distributed import Client, LocalCluster from toolz import sliding_window # dependency of dask + from xgboost.dask import DaskDMatrix from xgboost.testing.dask import check_init_estimation diff --git a/tests/test_distributed/test_with_spark/test_data.py b/tests/test_distributed/test_with_spark/test_data.py index af6732df7f86..b08fcdf1d110 100644 --- a/tests/test_distributed/test_with_spark/test_data.py +++ b/tests/test_distributed/test_with_spark/test_data.py @@ -8,6 +8,7 @@ pytestmark = [pytest.mark.skipif(**tm.no_spark())] +from xgboost import DMatrix, QuantileDMatrix from xgboost.spark.data import ( _read_csr_matrix_from_unwrapped_spark_vec, alias, @@ -15,8 +16,6 @@ stack_series, ) -from xgboost import DMatrix, QuantileDMatrix - def test_stack() -> None: a = pd.DataFrame({"a": [[1, 2], [3, 4]]}) diff --git a/tests/test_distributed/test_with_spark/test_spark_local.py b/tests/test_distributed/test_with_spark/test_spark_local.py index f6e5ceaf3940..33d60badce3f 100644 --- a/tests/test_distributed/test_with_spark/test_spark_local.py +++ b/tests/test_distributed/test_with_spark/test_spark_local.py @@ -8,10 +8,10 @@ import numpy as np import pytest -from xgboost.spark.data import pred_contribs import xgboost as xgb from xgboost import testing as tm +from xgboost.spark.data import pred_contribs pytestmark = [tm.timeout(60), pytest.mark.skipif(**tm.no_spark())] @@ -23,6 +23,8 @@ from pyspark.ml.tuning import CrossValidator, ParamGridBuilder from pyspark.sql import SparkSession from pyspark.sql import functions as spark_sql_func + +from xgboost import XGBClassifier, XGBModel, XGBRegressor from xgboost.spark import ( SparkXGBClassifier, SparkXGBClassifierModel, @@ -32,8 +34,6 @@ ) from xgboost.spark.core import _non_booster_params -from xgboost import XGBClassifier, XGBModel, XGBRegressor - from .utils import SparkTestCase logging.getLogger("py4j").setLevel(logging.INFO) diff --git a/tests/test_distributed/test_with_spark/test_spark_local_cluster.py b/tests/test_distributed/test_with_spark/test_spark_local_cluster.py index cd8acbb6e463..56003082fe3e 100644 --- a/tests/test_distributed/test_with_spark/test_spark_local_cluster.py +++ b/tests/test_distributed/test_with_spark/test_spark_local_cluster.py @@ -11,6 +11,7 @@ pytestmark = pytest.mark.skipif(**tm.no_spark()) from pyspark.ml.linalg import Vectors + from xgboost.spark import SparkXGBClassifier, SparkXGBRegressor from xgboost.spark.utils import _get_max_num_concurrent_tasks diff --git a/tests/test_distributed/test_with_spark/utils.py b/tests/test_distributed/test_with_spark/utils.py index 847316fea5aa..adc6b6069ba3 100644 --- a/tests/test_distributed/test_with_spark/utils.py +++ b/tests/test_distributed/test_with_spark/utils.py @@ -13,6 +13,7 @@ pytestmark = [pytest.mark.skipif(**tm.no_spark())] from pyspark.sql import SparkSession + from xgboost.spark.utils import _get_default_params_from_func