Skip to content

Commit 3304231

Browse files
fix: Change Estimator.logs() to use latest_training_job.name (#2059)
Co-authored-by: ChoiByungWook <[email protected]>
1 parent 81af40d commit 3304231

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/sagemaker/estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ def logs(self):
820820
If the output is a tty or a Jupyter cell, it will be color-coded based
821821
on which instance the log entry is from.
822822
"""
823-
self.sagemaker_session.logs_for_job(self.latest_training_job, wait=True)
823+
self.sagemaker_session.logs_for_job(self.latest_training_job.name, wait=True)
824824

825825
def deploy(
826826
self,

tests/unit/test_estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ def test_attach_no_logs(sagemaker_session, training_job_description):
14341434
def test_logs(sagemaker_session, training_job_description):
14351435
estimator = Estimator.attach(training_job_name="job", sagemaker_session=sagemaker_session)
14361436
estimator.logs()
1437-
sagemaker_session.logs_for_job.assert_called_with(estimator.latest_training_job, wait=True)
1437+
sagemaker_session.logs_for_job.assert_called_with(estimator.latest_training_job.name, wait=True)
14381438

14391439

14401440
def test_attach_without_hyperparameters(sagemaker_session, training_job_description):

0 commit comments

Comments
 (0)