File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed
tests/unit/sagemaker/jumpstart Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -1595,9 +1595,10 @@ def _add_model_access_configs_to_model_data_sources(
1595
1595
)
1596
1596
acked_model_data_sources .append (mutable_model_data_source )
1597
1597
else :
1598
- mutable_model_data_source .pop (
1599
- "HostingEulaKey"
1600
- ) # pop when model access config is not applicable
1598
+ if "HostingEulaKey" in mutable_model_data_source :
1599
+ mutable_model_data_source .pop (
1600
+ "HostingEulaKey"
1601
+ ) # pop when model access config is not applicable
1601
1602
acked_model_data_sources .append (mutable_model_data_source )
1602
1603
return acked_model_data_sources
1603
1604
Original file line number Diff line number Diff line change @@ -2318,6 +2318,28 @@ def test_multiple_gated_additional_model_data_source_should_accept_both(self):
2318
2318
+ self .MOCK_GATED_DEPLOY_CONFIG_ADDITIONAL_MODEL_DATA_SOURCE_POST_CALL
2319
2319
)
2320
2320
2321
+ def test_gated_additional_model_data_source_already_accepted_with_no_hosting_eula_key_should_pass_through (
2322
+ self ,
2323
+ ):
2324
+ mock_gated_deploy_config_additional_model_data_pre_accepted = [
2325
+ {
2326
+ "ChannelName" : "draft_model" ,
2327
+ "S3DataSource" : {
2328
+ "CompressionType" : "None" ,
2329
+ "S3DataType" : "S3Prefix" ,
2330
+ "S3Uri" : "s3://jumpstart_bucket/path/to/gated/resources/" ,
2331
+ "ModelAccessConfig" : {"AcceptEula" : True },
2332
+ },
2333
+ }
2334
+ ]
2335
+
2336
+ utils ._add_model_access_configs_to_model_data_sources (
2337
+ model_data_sources = mock_gated_deploy_config_additional_model_data_pre_accepted ,
2338
+ model_access_configs = {self .MOCK_GATED_MODEL_ID : ModelAccessConfig (accept_eula = False )},
2339
+ model_id = self .MOCK_GATED_MODEL_ID ,
2340
+ region = JUMPSTART_DEFAULT_REGION_NAME ,
2341
+ )
2342
+
2321
2343
# Mixed Positive Cases
2322
2344
2323
2345
def test_multiple_mixed_additional_model_data_source_should_pass_through_one_accept_the_other (
You can’t perform that action at this time.
0 commit comments