Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove try catch so error reflected if s3uri property not found and r…
…emoved unused imports
  • Loading branch information
ca-nguyen committed Jun 18, 2021
commit 63a7d550330704758ab655781d72f02ebff4132a
10 changes: 2 additions & 8 deletions src/stepfunctions/steps/sagemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,8 @@ def __init__(self, state_id, estimator, job_name, data=None, hyperparameters=Non
if data is not None and is_data_placeholder:
# Replace the 'S3Uri' key with one that supports JSONpath value.
# Support for uri str only: The list will only contain 1 element
try:
data_uri = parameters['InputDataConfig'][0]['DataSource']['S3DataSource'].pop('S3Uri', None)
parameters['InputDataConfig'][0]['DataSource']['S3DataSource']['S3Uri.$'] = data_uri
except KeyError as error:
logger.warning(f"Placeholder {data} used for data, but could not locate S3Uri property to make "
f"placeholder compatible.\n"
f"Path used:['InputDataConfig'][0]['DataSource']['S3DataSource']['S3Uri'] - "
f"{error} key was not found.")
data_uri = parameters['InputDataConfig'][0]['DataSource']['S3DataSource'].pop('S3Uri', None)
parameters['InputDataConfig'][0]['DataSource']['S3DataSource']['S3Uri.$'] = data_uri

if hyperparameters is not None:
parameters['HyperParameters'] = hyperparameters
Expand Down
1 change: 0 additions & 1 deletion tests/integ/test_sagemaker_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from sagemaker.tuner import HyperparameterTuner
from sagemaker.processing import ProcessingInput, ProcessingOutput

from stepfunctions.inputs import ExecutionInput, StepInput
from stepfunctions.steps import Chain
from stepfunctions.steps.sagemaker import TrainingStep, TransformStep, ModelStep, EndpointStep, EndpointConfigStep, TuningStep, ProcessingStep
from stepfunctions.workflow import Workflow
Expand Down