Skip to content

Commit

Permalink
service/sagemaker: Remove deprecated (helper/schema.ResourceData).Par…
Browse files Browse the repository at this point in the history
…tial() and (helper/schema.ResourceData).SetPartial() (hashicorp#12462)

Reference: hashicorp#12083
Reference: hashicorp#12087

Previously:

```
aws/resource_aws_sagemaker_endpoint.go:135:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_sagemaker_endpoint.go:144:2: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_sagemaker_endpoint.go:156:3: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_sagemaker_endpoint.go:168:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_sagemaker_model.go:284:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_sagemaker_model.go:294:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_sagemaker_notebook_instance.go:217:2: R007: deprecated (schema.ResourceData).Partial
aws/resource_aws_sagemaker_notebook_instance.go:226:2: R008: deprecated (schema.ResourceData).SetPartial
aws/resource_aws_sagemaker_notebook_instance.go:328:2: R007: deprecated (schema.ResourceData).Partial
```

Output from acceptance testing:

```
--- PASS: TestAccAWSSagemakerEndpoint_basic (485.91s)
--- PASS: TestAccAWSSagemakerEndpoint_EndpointConfigName (852.16s)
--- PASS: TestAccAWSSagemakerEndpoint_Tags (525.67s)

--- PASS: TestAccAWSSagemakerModel_basic (47.36s)
--- PASS: TestAccAWSSagemakerModel_containers (35.84s)
--- PASS: TestAccAWSSagemakerModel_networkIsolation (59.84s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerEnvironment (33.08s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerHostname (30.86s)
--- PASS: TestAccAWSSagemakerModel_primaryContainerModelDataUrl (57.54s)
--- PASS: TestAccAWSSagemakerModel_tags (42.35s)
--- PASS: TestAccAWSSagemakerModel_vpcConfig (62.13s)

--- PASS: TestAccAWSSagemakerNotebookInstance_basic (359.34s)
--- PASS: TestAccAWSSagemakerNotebookInstance_direct_internet_access (714.40s)
--- PASS: TestAccAWSSagemakerNotebookInstance_disappears (396.62s)
--- PASS: TestAccAWSSagemakerNotebookInstance_LifecycleConfigName (296.66s)
--- PASS: TestAccAWSSagemakerNotebookInstance_tags (411.90s)
--- PASS: TestAccAWSSagemakerNotebookInstance_update (625.72s)
```
  • Loading branch information
bflad authored and adamdecaf committed May 28, 2020
1 parent 3d11308 commit c9dc5fa
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
6 changes: 0 additions & 6 deletions aws/resource_aws_sagemaker_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,13 @@ func resourceAwsSagemakerEndpointRead(d *schema.ResourceData, meta interface{})
func resourceAwsSagemakerEndpointUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).sagemakerconn

d.Partial(true)

if d.HasChange("tags") {
o, n := d.GetChange("tags")

if err := keyvaluetags.SagemakerUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Sagemaker Endpoint (%s) tags: %s", d.Id(), err)
}
}
d.SetPartial("tags")

if d.HasChange("endpoint_config_name") {
modifyOpts := &sagemaker.UpdateEndpointInput{
Expand All @@ -153,7 +150,6 @@ func resourceAwsSagemakerEndpointUpdate(d *schema.ResourceData, meta interface{}
if _, err := conn.UpdateEndpoint(modifyOpts); err != nil {
return fmt.Errorf("error updating SageMaker Endpoint (%s): %s", d.Id(), err)
}
d.SetPartial("endpoint_config_name")

describeInput := &sagemaker.DescribeEndpointInput{
EndpointName: aws.String(d.Id()),
Expand All @@ -165,8 +161,6 @@ func resourceAwsSagemakerEndpointUpdate(d *schema.ResourceData, meta interface{}
}
}

d.Partial(false)

return resourceAwsSagemakerEndpointRead(d, meta)
}

Expand Down
4 changes: 0 additions & 4 deletions aws/resource_aws_sagemaker_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,6 @@ func flattenSageMakerVpcConfigResponse(vpcConfig *sagemaker.VpcConfig) []map[str
func resourceAwsSagemakerModelUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).sagemakerconn

d.Partial(true)

if d.HasChange("tags") {
o, n := d.GetChange("tags")

Expand All @@ -291,8 +289,6 @@ func resourceAwsSagemakerModelUpdate(d *schema.ResourceData, meta interface{}) e
}
}

d.Partial(false)

return resourceAwsSagemakerModelRead(d, meta)
}

Expand Down
5 changes: 0 additions & 5 deletions aws/resource_aws_sagemaker_notebook_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,13 @@ func resourceAwsSagemakerNotebookInstanceRead(d *schema.ResourceData, meta inter
func resourceAwsSagemakerNotebookInstanceUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).sagemakerconn

d.Partial(true)

if d.HasChange("tags") {
o, n := d.GetChange("tags")

if err := keyvaluetags.SagemakerUpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
return fmt.Errorf("error updating Sagemaker Notebook Instance (%s) tags: %s", d.Id(), err)
}
}
d.SetPartial("tags")

hasChanged := false
// Update
Expand Down Expand Up @@ -325,8 +322,6 @@ func resourceAwsSagemakerNotebookInstanceUpdate(d *schema.ResourceData, meta int
}
}

d.Partial(false)

return resourceAwsSagemakerNotebookInstanceRead(d, meta)
}

Expand Down

0 comments on commit c9dc5fa

Please sign in to comment.