19
19
from mock import Mock
20
20
21
21
from sagemaker .workflow .emr_step import EMRStep , EMRStepConfig
22
- < << << << HEAD
23
- from sagemaker .workflow .properties import Properties
24
- == == == =
25
- >> >> >> > feature : Add EMRStep support in Sagemaker pipeline
26
22
from sagemaker .workflow .steps import CacheConfig
27
23
from sagemaker .workflow .pipeline import Pipeline
28
24
from sagemaker .workflow .parameters import ParameterString
@@ -53,11 +49,7 @@ def test_emr_step_with_one_step_config(sagemaker_session):
53
49
name = "MyEMRStep" ,
54
50
display_name = "MyEMRStep" ,
55
51
description = "MyEMRStepDescription" ,
56
- << << << < HEAD
57
- job_flow_id = "MyClusterID" ,
58
- == == == =
59
52
cluster_id = "MyClusterID" ,
60
- >> >> >> > feature : Add EMRStep support in Sagemaker pipeline
61
53
step_config = emr_step_config ,
62
54
depends_on = ["TestStep" ],
63
55
cache_config = CacheConfig (enable_caching = True , expire_after = "PT1H" ),
@@ -67,11 +59,7 @@ def test_emr_step_with_one_step_config(sagemaker_session):
67
59
"Name" : "MyEMRStep" ,
68
60
"Type" : "EMR" ,
69
61
"Arguments" : {
70
- << << << < HEAD
71
- "JobFlowId" : "MyClusterID" ,
72
- == == == =
73
62
"ClusterId" : "MyClusterID" ,
74
- >> >> >> > feature : Add EMRStep support in Sagemaker pipeline
75
63
"StepConfig" : {
76
64
"HadoopJarStep" : {
77
65
"Args" : ["--arg_0" , "arg_0_value" ],
@@ -89,12 +77,7 @@ def test_emr_step_with_one_step_config(sagemaker_session):
89
77
"Description" : "MyEMRStepDescription" ,
90
78
"CacheConfig" : {"Enabled" : True , "ExpireAfter" : "PT1H" },
91
79
}
92
- << << << < HEAD
93
- assert emr_step .properties .Step .expr == {"Get" : "Steps.MyEMRStep.Step" }
94
80
95
-
96
- def test_pipeline_interpolates_lambda_outputs (sagemaker_session ):
97
- == == == =
98
81
assert emr_step .properties .ClusterId == "MyClusterID"
99
82
assert emr_step .properties .ActionOnFailure .expr == {"Get" : "Steps.MyEMRStep.ActionOnFailure" }
100
83
assert emr_step .properties .Config .Args .expr == {"Get" : "Steps.MyEMRStep.Config.Args" }
@@ -109,7 +92,6 @@ def test_pipeline_interpolates_lambda_outputs(sagemaker_session):
109
92
110
93
111
94
def test_pipeline_interpolates_emr_outputs (sagemaker_session ):
112
- >> >> >> > feature : Add EMRStep support in Sagemaker pipeline
113
95
parameter = ParameterString ("MyStr" )
114
96
115
97
emr_step_config_1 = EMRStepConfig (
@@ -121,11 +103,7 @@ def test_pipeline_interpolates_emr_outputs(sagemaker_session):
121
103
122
104
step_emr_1 = EMRStep (
123
105
name = "emr_step_1" ,
124
- << << << < HEAD
125
- job_flow_id = "MyClusterID" ,
126
- == == == =
127
106
cluster_id = "MyClusterID" ,
128
- >> >> >> > feature : Add EMRStep support in Sagemaker pipeline
129
107
display_name = "emr_step_1" ,
130
108
description = "MyEMRStepDescription" ,
131
109
depends_on = ["TestStep" ],
@@ -136,11 +114,7 @@ def test_pipeline_interpolates_emr_outputs(sagemaker_session):
136
114
137
115
step_emr_2 = EMRStep (
138
116
name = "emr_step_2" ,
139
- << << << < HEAD
140
- job_flow_id = "MyClusterID" ,
141
- == == == =
142
117
cluster_id = "MyClusterID" ,
143
- >> >> >> > feature : Add EMRStep support in Sagemaker pipeline
144
118
display_name = "emr_step_2" ,
145
119
description = "MyEMRStepDescription" ,
146
120
depends_on = ["TestStep" ],
@@ -167,11 +141,7 @@ def test_pipeline_interpolates_emr_outputs(sagemaker_session):
167
141
"Name" : "emr_step_1" ,
168
142
"Type" : "EMR" ,
169
143
"Arguments" : {
170
- << << << < HEAD
171
- "JobFlowId" : "MyClusterID" ,
172
- == == == =
173
144
"ClusterId" : "MyClusterID" ,
174
- >> >> >> > feature : Add EMRStep support in Sagemaker pipeline
175
145
"StepConfig" : {
176
146
"HadoopJarStep" : {
177
147
"Args" : ["--arg_0" , "arg_0_value" ],
@@ -192,11 +162,7 @@ def test_pipeline_interpolates_emr_outputs(sagemaker_session):
192
162
"Name" : "emr_step_2" ,
193
163
"Type" : "EMR" ,
194
164
"Arguments" : {
195
- << << << < HEAD
196
- "JobFlowId" : "MyClusterID" ,
197
- == == == =
198
165
"ClusterId" : "MyClusterID" ,
199
- >> >> >> > feature : Add EMRStep support in Sagemaker pipeline
200
166
"StepConfig" : {
201
167
"HadoopJarStep" : {"Jar" : "s3:/script-runner/script-runner_2.jar" }
202
168
},
@@ -207,15 +173,3 @@ def test_pipeline_interpolates_emr_outputs(sagemaker_session):
207
173
},
208
174
],
209
175
}
210
- << << << < HEAD
211
-
212
-
213
- def test_properties_describe_step_output ():
214
- prop = Properties ("Steps.MyStep" , "DescribeStepOutput" , external_service_name = "emr" )
215
- some_prop_names = ["Step" ]
216
- print (prop .__dict__ .keys ())
217
- for name in some_prop_names :
218
- assert name in prop .__dict__ .keys ()
219
- assert prop .Step .expr == {"Get" : "Steps.MyStep.Step" }
220
- == == == =
221
- >> >> >> > feature : Add EMRStep support in Sagemaker pipeline
0 commit comments