Skip to content

Commit c066263

Browse files
author
Chuyang Deng
committed
add warning
1 parent 7751e62 commit c066263

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/sagemaker/automl/automl.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"""A class for SageMaker AutoML Jobs."""
1414
from __future__ import absolute_import
1515

16+
import logging
1617
from six import string_types
1718

1819
from sagemaker import Model, PipelineModel
@@ -21,6 +22,8 @@
2122
from sagemaker.session import Session
2223
from sagemaker.utils import name_from_base
2324

25+
logger = logging.getLogger("sagemaker")
26+
2427

2528
class AutoML(object):
2629
"""A class for creating and interacting with SageMaker AutoML jobs
@@ -83,8 +86,11 @@ def fit(self, inputs=None, wait=True, logs=True, job_name=None):
8386
job_name (str): Training job name. If not specified, the estimator generates
8487
a default job name, based on the training image name and current timestamp.
8588
"""
86-
if not wait:
89+
if not wait and logs:
8790
logs = False
91+
logger.warning(
92+
"logs will be set to False. logs is only meaningful when wait is True."
93+
)
8894

8995
# upload data for users if provided local path
9096
# validations are done in _Job._format_inputs_to_input_config

tests/unit/sagemaker/automl/test_auto_ml.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def test_auto_ml_only_one_of_problem_type_and_job_objective_provided(sagemaker_s
228228
)
229229

230230

231-
def test_auto_ml_additional_optional_params(sagemaker_session):
231+
def test_auto_ml_additional_optional_params(sagemaker_session, caplog):
232232
auto_ml = AutoML(
233233
role=ROLE,
234234
target_attribute_name=TARGET_ATTRIBUTE_NAME,
@@ -282,6 +282,7 @@ def test_auto_ml_additional_optional_params(sagemaker_session):
282282
"generate_candidate_definitions_only": GENERATE_CANDIDATE_DEFINITIONS_ONLY,
283283
"tags": TAGS,
284284
}
285+
assert "logs will be set to False. logs is only meaningful when wait is True." in caplog.text
285286

286287

287288
@patch("time.strftime", return_value=TIMESTAMP)

0 commit comments

Comments
 (0)