Skip to content

Fix: Fix job_objective type #4303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sagemaker/automl/automl.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def attach(cls, auto_ml_job_name, sagemaker_session=None):
total_job_runtime_in_seconds=auto_ml_job_desc.get("AutoMLJobConfig", {})
.get("CompletionCriteria", {})
.get("MaxAutoMLJobRuntimeInSeconds"),
job_objective=auto_ml_job_desc.get("AutoMLJobObjective", {}).get("MetricName"),
job_objective=auto_ml_job_desc.get("AutoMLJobObjective", {}),
generate_candidate_definitions_only=auto_ml_job_desc.get(
"GenerateCandidateDefinitionsOnly", False
),
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/sagemaker/workflow/test_automl_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_single_automl_step(pipeline_session):
max_candidates=1,
max_runtime_per_training_job_in_seconds=3600,
total_job_runtime_in_seconds=36000,
job_objective="fake job objective",
job_objective={"MetricName": "F1"},
generate_candidate_definitions_only=False,
tags=[{"Name": "some-tag", "Value": "value-for-tag"}],
content_type="x-application/vnd.amazon+parquet",
Expand Down Expand Up @@ -111,7 +111,7 @@ def test_single_automl_step(pipeline_session):
"VpcConfig": {"SecurityGroupIds": ["group"], "Subnets": ["subnet"]},
},
},
"AutoMLJobObjective": "fake job objective",
"AutoMLJobObjective": {"MetricName": "F1"},
"InputDataConfig": [
{
"ChannelType": "training",
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_single_automl_step_with_parameter(pipeline_session):
max_candidates=1,
max_runtime_per_training_job_in_seconds=3600,
total_job_runtime_in_seconds=36000,
job_objective="fake job objective",
job_objective={"MetricName": "F1"},
generate_candidate_definitions_only=False,
tags=[{"Name": "some-tag", "Value": "value-for-tag"}],
content_type="x-application/vnd.amazon+parquet",
Expand Down Expand Up @@ -239,7 +239,7 @@ def test_single_automl_step_with_parameter(pipeline_session):
"VpcConfig": {"SecurityGroupIds": ["group"], "Subnets": ["subnet"]},
},
},
"AutoMLJobObjective": "fake job objective",
"AutoMLJobObjective": {"MetricName": "F1"},
"InputDataConfig": [
{
"ChannelType": "training",
Expand Down Expand Up @@ -290,7 +290,7 @@ def test_get_best_auto_ml_model(pipeline_session):
max_candidates=1,
max_runtime_per_training_job_in_seconds=3600,
total_job_runtime_in_seconds=36000,
job_objective="fake job objective",
job_objective={"MetricName": "F1"},
generate_candidate_definitions_only=False,
tags=[{"Name": "some-tag", "Value": "value-for-tag"}],
content_type="x-application/vnd.amazon+parquet",
Expand Down Expand Up @@ -399,7 +399,7 @@ def test_automl_step_with_invalid_mode(pipeline_session):
max_candidates=1,
max_runtime_per_training_job_in_seconds=3600,
total_job_runtime_in_seconds=36000,
job_objective="fake job objective",
job_objective={"MetricName": "F1"},
generate_candidate_definitions_only=False,
tags=[{"Name": "some-tag", "Value": "value-for-tag"}],
content_type="x-application/vnd.amazon+parquet",
Expand Down Expand Up @@ -455,7 +455,7 @@ def test_automl_step_with_no_mode(pipeline_session):
max_candidates=1,
max_runtime_per_training_job_in_seconds=3600,
total_job_runtime_in_seconds=36000,
job_objective="fake job objective",
job_objective={"MetricName": "F1"},
generate_candidate_definitions_only=False,
tags=[{"Name": "some-tag", "Value": "value-for-tag"}],
content_type="x-application/vnd.amazon+parquet",
Expand Down