Skip to content

Commit 642dcc9

Browse files
sararobcopybara-github
authored andcommitted
chore: Make XGB tests compatible with sklearn 1.8
PiperOrigin-RevId: 858666892
1 parent 682e65f commit 642dcc9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/unit/aiplatform/test_metadata_models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ def create_model_file(filename):
157157
@pytest.fixture
158158
def mock_storage_blob_download_xgboost_xgbmodel_file():
159159
def create_model_file(filename):
160+
xgb.XGBClassifier._estimator_type = "classifier"
160161
x, y = make_classification()
161162
model = xgb.XGBClassifier()
163+
model._estimator_type = "classifier"
162164
model.fit(x, y)
163165
model.save_model(filename)
164166

@@ -522,6 +524,7 @@ def test_save_model_xgboost_xgbmodel(
522524

523525
x, y = make_classification()
524526
xgb_model = xgb.XGBClassifier()
527+
xgb_model._estimator_type = "classifier"
525528
xgb_model.fit(x, y)
526529

527530
aiplatform.init(

0 commit comments

Comments
 (0)