File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ dependencies:
36
36
- cloudpickle
37
37
- shap
38
38
- modin
39
+ # TODO: Replace it with pyspark>=3.4 once 3.4 released.
40
+ # - https://ml-team-public-read.s3.us-west-2.amazonaws.com/pyspark-3.4.0.dev0.tar.gz
41
+ - pyspark>=3.3.1
39
42
- pip :
40
43
- datatable
41
- # TODO: Replace it with pyspark>=3.4 once 3.4 released.
42
- - https://ml-team-public-read.s3.us-west-2.amazonaws.com/pyspark-3.4.0.dev0.tar.gz
Original file line number Diff line number Diff line change 41
41
pytestmark = testing .timeout (60 )
42
42
43
43
44
+ def no_sparse_unwrap ():
45
+ try :
46
+ from pyspark .sql .functions import unwrap_udt
47
+
48
+ except ImportError :
49
+ return {"reason" : "PySpark<3.4" , "condition" : True }
50
+
51
+ return {"reason" : "PySpark<3.4" , "condition" : False }
52
+
53
+
44
54
class XgboostLocalTest (SparkTestCase ):
45
55
def setUp (self ):
46
56
logging .getLogger ().setLevel ("INFO" )
@@ -985,6 +995,7 @@ def test_classifier_with_feature_names_types_weights(self):
985
995
model = classifier .fit (self .cls_df_train )
986
996
model .transform (self .cls_df_test ).collect ()
987
997
998
+ @pytest .mark .skipif (** no_sparse_unwrap ())
988
999
def test_regressor_with_sparse_optim (self ):
989
1000
regressor = SparkXGBRegressor (missing = 0.0 )
990
1001
model = regressor .fit (self .reg_df_sparse_train )
@@ -1001,6 +1012,7 @@ def test_regressor_with_sparse_optim(self):
1001
1012
for row1 , row2 in zip (pred_result , pred_result2 ):
1002
1013
self .assertTrue (np .isclose (row1 .prediction , row2 .prediction , atol = 1e-3 ))
1003
1014
1015
+ @pytest .mark .skipif (** no_sparse_unwrap ())
1004
1016
def test_classifier_with_sparse_optim (self ):
1005
1017
cls = SparkXGBClassifier (missing = 0.0 )
1006
1018
model = cls .fit (self .cls_df_sparse_train )
You can’t perform that action at this time.
0 commit comments