Skip to content

Commit 263fe22

Browse files
authored
Merge branch 'master' into fix/estimator-hyperparameters
2 parents 4a6912f + 766e8ec commit 263fe22

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/sagemaker/local/pipeline.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,15 @@ def _parse_arguments(self, obj, step_name):
8989
if isinstance(obj, dict):
9090
obj_copy = deepcopy(obj)
9191
for k, v in obj.items():
92-
if isinstance(v, dict):
93-
obj_copy[k] = self._parse_arguments(v, step_name)
94-
elif isinstance(v, list):
95-
list_copy = []
96-
for item in v:
97-
list_copy.append(self._parse_arguments(item, step_name))
98-
obj_copy[k] = list_copy
99-
elif isinstance(v, PipelineVariable):
100-
obj_copy[k] = self.evaluate_pipeline_variable(v, step_name)
92+
obj_copy[k] = self._parse_arguments(v, step_name)
10193
return obj_copy
94+
if isinstance(obj, list):
95+
list_copy = []
96+
for item in obj:
97+
list_copy.append(self._parse_arguments(item, step_name))
98+
return list_copy
99+
if isinstance(obj, PipelineVariable):
100+
return self.evaluate_pipeline_variable(obj, step_name)
102101
return obj
103102

104103
def evaluate_pipeline_variable(self, pipeline_variable, step_name):

tests/integ/test_local_mode.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from sagemaker.workflow.pipeline import Pipeline
3636
from sagemaker.workflow.steps import TrainingStep, ProcessingStep, TransformStep
3737
from sagemaker.workflow.model_step import ModelStep
38-
from sagemaker.workflow.parameters import ParameterInteger
38+
from sagemaker.workflow.parameters import ParameterInteger, ParameterString
3939
from sagemaker.workflow.condition_step import ConditionStep
4040
from sagemaker.workflow.fail_step import FailStep
4141
from sagemaker.workflow.conditions import ConditionLessThanOrEqualTo
@@ -496,6 +496,7 @@ def test_local_processing_script_processor(sagemaker_local_session, sklearn_imag
496496

497497
@pytest.mark.local_mode
498498
def test_local_pipeline_with_processing_step(sklearn_latest_version, local_pipeline_session):
499+
string_container_arg = ParameterString(name="ProcessingContainerArg", default_value="foo")
499500
sklearn_processor = SKLearnProcessor(
500501
framework_version=sklearn_latest_version,
501502
role="SageMakerRole",
@@ -509,6 +510,7 @@ def test_local_pipeline_with_processing_step(sklearn_latest_version, local_pipel
509510
processing_args = sklearn_processor.run(
510511
code=script_path,
511512
inputs=[ProcessingInput(source=input_file_path, destination="/opt/ml/processing/inputs/")],
513+
arguments=["--container_arg", string_container_arg],
512514
)
513515
processing_step = ProcessingStep(
514516
name="sklearn_processor_local_pipeline", step_args=processing_args
@@ -517,6 +519,7 @@ def test_local_pipeline_with_processing_step(sklearn_latest_version, local_pipel
517519
name="local_pipeline_processing",
518520
steps=[processing_step],
519521
sagemaker_session=local_pipeline_session,
522+
parameters=[string_container_arg],
520523
)
521524
pipeline.create("SageMakerRole", "pipeline for sdk integ testing")
522525

0 commit comments

Comments
 (0)