Skip to content

Commit 319b5f0

Browse files
author
Payton Staub
committed
Fix flake8
1 parent 14b743a commit 319b5f0

File tree

1 file changed

+45
-44
lines changed

1 file changed

+45
-44
lines changed

tests/unit/sagemaker/workflow/test_callback_step.py

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
from sagemaker.workflow.pipeline import Pipeline
2323
from sagemaker.workflow.callback_step import CallbackStep, CallbackOutput, CallbackOutputTypeEnum
2424

25-
from tests.unit.sagemaker.workflow.helpers import ordered
2625

2726
@pytest.fixture
2827
def sagemaker_session_mock():
2928
return Mock()
3029

30+
3131
def test_callback_step():
3232
param = ParameterInteger(name="MyInt")
3333
outputParam1 = CallbackOutput(output_name="output1", output_type=CallbackOutputTypeEnum.String)
@@ -52,6 +52,7 @@ def test_callback_step():
5252
"Arguments": {"arg1": "foo", "arg2": 5, "arg3": param},
5353
}
5454

55+
5556
def test_callback_step_output_expr():
5657
param = ParameterInteger(name="MyInt")
5758
outputParam1 = CallbackOutput(output_name="output1", output_type=CallbackOutputTypeEnum.String)
@@ -67,6 +68,7 @@ def test_callback_step_output_expr():
6768
assert cb_step.properties.Outputs['output1'].expr == {"Get": "Steps.MyCallbackStep.OutputParameters['output1']"}
6869
assert cb_step.properties.Outputs['output2'].expr == {"Get": "Steps.MyCallbackStep.OutputParameters['output2']"}
6970

71+
7072
def test_pipeline_interpolates_callback_outputs():
7173
parameter = ParameterString("MyStr")
7274
outputParam1 = CallbackOutput(output_name="output1", output_type=CallbackOutputTypeEnum.String)
@@ -94,48 +96,47 @@ def test_pipeline_interpolates_callback_outputs():
9496
)
9597

9698
assert json.loads(pipeline.definition()) == {
97-
"Version": "2020-12-01",
98-
"Metadata": {},
99-
"Parameters": [{"Name": "MyStr", "Type": "String"}],
100-
"PipelineExperimentConfig": {
101-
"ExperimentName": {"Get": "Execution.PipelineName"},
102-
"TrialName": {"Get": "Execution.PipelineExecutionId"},
99+
"Version": "2020-12-01",
100+
"Metadata": {},
101+
"Parameters": [{"Name": "MyStr", "Type": "String"}],
102+
"PipelineExperimentConfig": {
103+
"ExperimentName": {"Get": "Execution.PipelineName"},
104+
"TrialName": {"Get": "Execution.PipelineExecutionId"},
105+
},
106+
"Steps": [
107+
{
108+
"Name": "MyCallbackStep1",
109+
"Type": "Callback",
110+
"Arguments": {
111+
"arg1": "foo"
112+
},
113+
"DependsOn": [
114+
"TestStep"
115+
],
116+
"SqsQueueUrl": "https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue",
117+
"OutputParameters": [
118+
{
119+
"OutputName": "output1",
120+
"OutputType": "String"
121+
}
122+
]
103123
},
104-
"Steps": [
105-
{
106-
"Name": "MyCallbackStep1",
107-
"Type": "Callback",
108-
"Arguments": {
109-
"arg1": "foo"
110-
},
111-
"DependsOn": [
112-
"TestStep"
113-
],
114-
"SqsQueueUrl": "https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue",
115-
"OutputParameters": [
116-
{
117-
"OutputName": "output1",
118-
"OutputType": "String"
119-
}
120-
]
124+
{
125+
"Name": "MyCallbackStep2",
126+
"Type": "Callback",
127+
"Arguments": {
128+
"arg1": {"Get": "Steps.MyCallbackStep1.OutputParameters['output1']"}
121129
},
122-
{
123-
"Name": "MyCallbackStep2",
124-
"Type": "Callback",
125-
"Arguments": {
126-
"arg1": { "Get": "Steps.MyCallbackStep1.OutputParameters['output1']"}
127-
},
128-
"DependsOn": [
129-
"TestStep"
130-
],
131-
"SqsQueueUrl": "https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue",
132-
"OutputParameters": [
133-
{
134-
"OutputName": "output2",
135-
"OutputType": "String"
136-
}
137-
]
138-
}
139-
]
140-
}
141-
130+
"DependsOn": [
131+
"TestStep"
132+
],
133+
"SqsQueueUrl": "https://sqs.us-east-2.amazonaws.com/123456789012/MyQueue",
134+
"OutputParameters": [
135+
{
136+
"OutputName": "output2",
137+
"OutputType": "String"
138+
}
139+
]
140+
}
141+
]
142+
}

0 commit comments

Comments
 (0)