Skip to content

fix: issue #2253 where Processing job in Local mode would call Describe… #2282

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 12 commits into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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
15 changes: 15 additions & 0 deletions src/sagemaker/local/local_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,21 @@ def logs_for_job(self, job_name, wait=False, poll=5, log_type="All"):
# on local mode.
pass # pylint: disable=unnecessary-pass

def logs_for_processing_job(self, job_name, wait=False, poll=10):
"""A no-op method meant to override the sagemaker client.

Args:
job_name:
wait: (Default value = False)
poll: (Default value = 10)

Returns:

"""
# override logs_for_job() as it doesn't need to perform any action
# on local mode.
pass # pylint: disable=unnecessary-pass


class file_input(object):
"""Amazon SageMaker channel configuration for FILE data sources, used in local mode."""
Expand Down
14 changes: 14 additions & 0 deletions tests/unit/test_local_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,20 @@ def test_describe_transform_job_does_not_exist(LocalSession, _LocalTransformJob)
local_sagemaker_client.describe_transform_job("transform-job-does-not-exist")


@patch("sagemaker.local.image._SageMakerContainer.process")
@patch("sagemaker.local.local_session.LocalSession")
def test_logs_for_job(process, LocalSession):
local_job_logs = LocalSession.logs_for_job("my-processing-job")
assert local_job_logs is not None


@patch("sagemaker.local.image._SageMakerContainer.process")
@patch("sagemaker.local.local_session.LocalSession")
def test_logs_for_processing_job(process, LocalSession):
local_processing_job_logs = LocalSession.logs_for_processing_job("my-processing-job")
assert local_processing_job_logs is not None


@patch("sagemaker.local.local_session.LocalSession")
def test_describe_endpoint_config(LocalSession):
local_sagemaker_client = sagemaker.local.local_session.LocalSagemakerClient()
Expand Down