Skip to content

Commit

Permalink
fix: add forceNew to google_vertex_ai_featurestore_entitytype_feature…
Browse files Browse the repository at this point in the history
… value_type field (#7124) (#13491)

Fixes #13485

Signed-off-by: Modular Magician <[email protected]>

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jan 13, 2023
1 parent a27e9ce commit fad69fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .changelog/7124.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
vertexai: fixed updating value_type in google_vertex_ai_featurestore_entitytype_feature
```
11 changes: 1 addition & 10 deletions google/resource_vertex_ai_featurestore_entitytype_feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func resourceVertexAIFeaturestoreEntitytypeFeature() *schema.Resource {
"value_type": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: `Type of Feature value. Immutable. https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.featurestores.entityTypes.features#ValueType`,
},
"description": {
Expand Down Expand Up @@ -243,12 +244,6 @@ func resourceVertexAIFeaturestoreEntitytypeFeatureUpdate(d *schema.ResourceData,
} else if v, ok := d.GetOkExists("description"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp
}
valueTypeProp, err := expandVertexAIFeaturestoreEntitytypeFeatureValueType(d.Get("value_type"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("value_type"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, valueTypeProp)) {
obj["valueType"] = valueTypeProp
}

url, err := replaceVars(d, config, "{{VertexAIBasePath}}{{entitytype}}/features/{{name}}")
if err != nil {
Expand All @@ -265,10 +260,6 @@ func resourceVertexAIFeaturestoreEntitytypeFeatureUpdate(d *schema.ResourceData,
if d.HasChange("description") {
updateMask = append(updateMask, "description")
}

if d.HasChange("value_type") {
updateMask = append(updateMask, "valueType")
}
// updateMask is a URL parameter but not present in the schema, so replaceVars
// won't set it
url, err = addQueryParams(url, map[string]string{"updateMask": strings.Join(updateMask, ",")})
Expand Down

0 comments on commit fad69fe

Please sign in to comment.