Skip to content

Commit 63a7d55

Browse files
committed
Remove try catch so error reflected if s3uri property not found and removed unused imports
1 parent 0572245 commit 63a7d55

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/stepfunctions/steps/sagemaker.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,8 @@ def __init__(self, state_id, estimator, job_name, data=None, hyperparameters=Non
118118
if data is not None and is_data_placeholder:
119119
# Replace the 'S3Uri' key with one that supports JSONpath value.
120120
# Support for uri str only: The list will only contain 1 element
121-
try:
122-
data_uri = parameters['InputDataConfig'][0]['DataSource']['S3DataSource'].pop('S3Uri', None)
123-
parameters['InputDataConfig'][0]['DataSource']['S3DataSource']['S3Uri.$'] = data_uri
124-
except KeyError as error:
125-
logger.warning(f"Placeholder {data} used for data, but could not locate S3Uri property to make "
126-
f"placeholder compatible.\n"
127-
f"Path used:['InputDataConfig'][0]['DataSource']['S3DataSource']['S3Uri'] - "
128-
f"{error} key was not found.")
121+
data_uri = parameters['InputDataConfig'][0]['DataSource']['S3DataSource'].pop('S3Uri', None)
122+
parameters['InputDataConfig'][0]['DataSource']['S3DataSource']['S3Uri.$'] = data_uri
129123

130124
if hyperparameters is not None:
131125
parameters['HyperParameters'] = hyperparameters

tests/integ/test_sagemaker_steps.py

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from sagemaker.tuner import HyperparameterTuner
3030
from sagemaker.processing import ProcessingInput, ProcessingOutput
3131

32-
from stepfunctions.inputs import ExecutionInput, StepInput
3332
from stepfunctions.steps import Chain
3433
from stepfunctions.steps.sagemaker import TrainingStep, TransformStep, ModelStep, EndpointStep, EndpointConfigStep, TuningStep, ProcessingStep
3534
from stepfunctions.workflow import Workflow

0 commit comments

Comments
 (0)