Skip to content

Commit f218d1c

Browse files
yinghsienwucopybara-github
authored andcommitted
chore: fix internal test infra
PiperOrigin-RevId: 731020180
1 parent e356f5a commit f218d1c

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎google/cloud/aiplatform/metadata/_models.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,16 @@ def save_model(
438438
) and model.__class__.__module__.startswith("sklearn"):
439439
framework_name = "sklearn"
440440
framework_version = sklearn.__version__
441+
try:
442+
import sklearn.v1_0_2
443+
except ImportError:
444+
pass
445+
else:
446+
if isinstance(
447+
model, sklearn.v1_0_2.base.BaseEstimator
448+
) and model.__class__.__module__.startswith("sklearn"):
449+
framework_name = "sklearn"
450+
framework_version = sklearn.v1_0_2.__version__
441451

442452
try:
443453
import xgboost as xgb

‎tests/unit/architecture/test_vertexai_import.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def test_vertexai_import():
8484
assert sorted(new_modules_after_vertexai) == [vertexai_module_name]
8585

8686
assert vertexai_import_timedelta.total_seconds() < 0.005
87-
assert aip_import_timedelta.total_seconds() < 20
87+
assert aip_import_timedelta.total_seconds() < 23
8888

8989
# Testing that external modules are not loaded.
9090
new_modules = modules_after_vertexai - modules_before_aip

0 commit comments

Comments
 (0)