Skip to content

fix: Change Estimator.logs() to use latest_training_job.name #2059

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 7 commits into from
Mar 3, 2021
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/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ def logs(self):
If the output is a tty or a Jupyter cell, it will be color-coded based
on which instance the log entry is from.
"""
self.sagemaker_session.logs_for_job(self.latest_training_job, wait=True)
self.sagemaker_session.logs_for_job(self.latest_training_job.name, wait=True)

def deploy(
self,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ def test_attach_no_logs(sagemaker_session, training_job_description):
def test_logs(sagemaker_session, training_job_description):
estimator = Estimator.attach(training_job_name="job", sagemaker_session=sagemaker_session)
estimator.logs()
sagemaker_session.logs_for_job.assert_called_with(estimator.latest_training_job, wait=True)
sagemaker_session.logs_for_job.assert_called_with(estimator.latest_training_job.name, wait=True)


def test_attach_without_hyperparameters(sagemaker_session, training_job_description):
Expand Down