Skip to content

Commit c93f5be

Browse files
Anton RepushkoH. Furkan Bozkurt
Anton Repushko
authored and
H. Furkan Bozkurt
committed
Improvements of the integration tests
1 parent f78fda2 commit c93f5be

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/sagemaker/automl/automlv2.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,8 @@ def best_candidate(self, job_name=None):
877877
"""Returns the best candidate of an AutoML job for a given name.
878878
879879
Args:
880-
job_name (str): The name of the AutoML job. If None, will use object's
881-
_current_auto_ml_job_name.
880+
job_name (str): The name of the AutoML job. If None, object's
881+
_current_auto_ml_job_name will be used.
882882
883883
Returns:
884884
dict: A dictionary with information of the best candidate.

tests/integ/auto_ml_v2_utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
item_identifier_attribute_name="item_id",
7070
target_attribute_name="target",
7171
timestamp_attribute_name="timestamp",
72+
forecast_quantiles=["p10", "p50", "p90"],
7273
),
7374
}
7475

tests/integ/test_auto_ml_v2.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,10 @@ def test_auto_ml_v2_attach(problem_type, job_name_fixture_key, sagemaker_session
174174
assert desc["AutoMLJobName"] == job_name
175175
assert desc["AutoMLJobStatus"] in ["InProgress", "Completed"]
176176
assert desc["AutoMLJobSecondaryStatus"] != "Failed"
177-
assert desc["ProblemConfig"] == auto_ml_v2_utils.PROBLEM_CONFIGS[problem_type]
177+
assert (
178+
desc["AutoMLProblemTypeConfig"]
179+
== auto_ml_v2_utils.PROBLEM_CONFIGS[problem_type].to_request_dict()
180+
)
178181
assert desc["OutputDataConfig"] == expected_default_output_config
179182

180183

@@ -251,6 +254,8 @@ def test_list_candidates(
251254

252255
candidates = auto_ml.list_candidates(job_name=job_name)
253256
assert len(candidates) == num_candidates
257+
else:
258+
pytest.skip("The job hasn't finished yet")
254259

255260

256261
@pytest.mark.skipif(
@@ -320,6 +325,8 @@ def test_best_candidate(
320325
best_candidate = auto_ml.best_candidate(job_name=job_name)
321326
assert len(best_candidate["InferenceContainers"]) == num_containers
322327
assert best_candidate["CandidateStatus"] == "Completed"
328+
else:
329+
pytest.skip("The job hasn't finished yet")
323330

324331

325332
@pytest.mark.skipif(
@@ -411,6 +418,8 @@ def test_deploy_best_candidate(
411418
)["EndpointStatus"]
412419
assert endpoint_status == "InService"
413420
sagemaker_session.sagemaker_client.delete_endpoint(EndpointName=endpoint_name)
421+
else:
422+
pytest.skip("The job hasn't finished yet")
414423

415424

416425
@pytest.mark.skipif(
@@ -482,3 +491,5 @@ def test_candidate_estimator_get_steps(
482491
candidate_estimator = CandidateEstimator(candidate, sagemaker_session)
483492
steps = candidate_estimator.get_steps()
484493
assert len(steps) == num_steps
494+
else:
495+
pytest.skip("The job hasn't finished yet")

0 commit comments

Comments
 (0)