Use black on more Python files. (#8137)
This commit is contained in:
@@ -112,13 +112,25 @@ if __name__ == "__main__":
|
||||
if not all(
|
||||
run_formatter(path)
|
||||
for path in [
|
||||
# core
|
||||
"python-package/xgboost/__init__.py",
|
||||
"python-package/xgboost/_typing.py",
|
||||
"python-package/xgboost/compat.py",
|
||||
"python-package/xgboost/config.py",
|
||||
"python-package/xgboost/dask.py",
|
||||
"python-package/xgboost/sklearn.py",
|
||||
"python-package/xgboost/spark",
|
||||
"python-package/xgboost/federated.py",
|
||||
"python-package/xgboost/spark",
|
||||
# tests
|
||||
"tests/python/test_config.py",
|
||||
"tests/python/test_spark/test_data.py",
|
||||
"tests/python-gpu/test_gpu_spark/test_data.py",
|
||||
"tests/python/test_spark/",
|
||||
"tests/python-gpu/test_gpu_spark/",
|
||||
"tests/ci_build/lint_python.py",
|
||||
# demo
|
||||
"demo/guide-python/cat_in_the_dat.py",
|
||||
"demo/guide-python/categorical.py",
|
||||
"demo/guide-python/spark_estimator_examples.py",
|
||||
]
|
||||
):
|
||||
sys.exit(-1)
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import sys
|
||||
import logging
|
||||
import random
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
import testing as tm
|
||||
|
||||
if tm.no_spark()["condition"]:
|
||||
@@ -13,26 +12,27 @@ if tm.no_spark()["condition"]:
|
||||
if sys.platform.startswith("win") or sys.platform.startswith("darwin"):
|
||||
pytest.skip("Skipping PySpark tests on Windows", allow_module_level=True)
|
||||
|
||||
from pyspark.ml.functions import vector_to_array
|
||||
from pyspark.sql import functions as spark_sql_func
|
||||
from pyspark.ml import Pipeline, PipelineModel
|
||||
from pyspark.ml.evaluation import (
|
||||
BinaryClassificationEvaluator,
|
||||
MulticlassClassificationEvaluator,
|
||||
)
|
||||
from pyspark.ml.functions import vector_to_array
|
||||
from pyspark.ml.linalg import Vectors
|
||||
from pyspark.ml.tuning import CrossValidator, ParamGridBuilder
|
||||
|
||||
from pyspark.sql import functions as spark_sql_func
|
||||
from xgboost.spark import (
|
||||
SparkXGBClassifier,
|
||||
SparkXGBClassifierModel,
|
||||
SparkXGBRegressor,
|
||||
SparkXGBRegressorModel,
|
||||
)
|
||||
from .utils import SparkTestCase
|
||||
from xgboost import XGBClassifier, XGBRegressor
|
||||
from xgboost.spark.core import _non_booster_params
|
||||
|
||||
from xgboost import XGBClassifier, XGBRegressor
|
||||
|
||||
from .utils import SparkTestCase
|
||||
|
||||
logging.getLogger("py4j").setLevel(logging.INFO)
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import sys
|
||||
import random
|
||||
import json
|
||||
import uuid
|
||||
import os
|
||||
import random
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
import numpy as np
|
||||
import pytest
|
||||
import testing as tm
|
||||
|
||||
if tm.no_spark()["condition"]:
|
||||
@@ -13,10 +13,11 @@ if tm.no_spark()["condition"]:
|
||||
if sys.platform.startswith("win") or sys.platform.startswith("darwin"):
|
||||
pytest.skip("Skipping PySpark tests on Windows", allow_module_level=True)
|
||||
|
||||
from .utils import SparkLocalClusterTestCase
|
||||
from pyspark.ml.linalg import Vectors
|
||||
from xgboost.spark import SparkXGBClassifier, SparkXGBRegressor
|
||||
from xgboost.spark.utils import _get_max_num_concurrent_tasks
|
||||
from pyspark.ml.linalg import Vectors
|
||||
|
||||
from .utils import SparkLocalClusterTestCase
|
||||
|
||||
|
||||
class XgboostLocalClusterTestCase(SparkLocalClusterTestCase):
|
||||
|
||||
@@ -3,22 +3,18 @@ import logging
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
import unittest
|
||||
|
||||
import pytest
|
||||
|
||||
from six import StringIO
|
||||
|
||||
import testing as tm
|
||||
from six import StringIO
|
||||
|
||||
if tm.no_spark()["condition"]:
|
||||
pytest.skip(msg=tm.no_spark()["reason"], allow_module_level=True)
|
||||
if sys.platform.startswith("win") or sys.platform.startswith("darwin"):
|
||||
pytest.skip("Skipping PySpark tests on Windows", allow_module_level=True)
|
||||
|
||||
from pyspark.sql import SQLContext
|
||||
from pyspark.sql import SparkSession
|
||||
|
||||
from pyspark.sql import SparkSession, SQLContext
|
||||
from xgboost.spark.utils import _get_default_params_from_func
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user