Skip to content

Commit 1f04964

Browse files
committed
fix test
1 parent 4c0ba59 commit 1f04964

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

internal/provider/profiles_warehouse_resource.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,19 @@ func findProfileWarehouse(authContext context.Context, client *api.APIClient, id
367367
// determineSchemaNameForUpdate determines whether schemaName should be sent to the API
368368
// based on comparing the plan and state values. This prevents API failures when the
369369
// schema name already exists in the warehouse configuration.
370+
//
371+
// The function returns nil (not sent to API) when:
372+
// - Plan value is unknown (should not send unknown values to API)
373+
// - Plan and state values are equal (no change needed)
374+
//
375+
// The function returns a pointer to the plan value when:
376+
// - Plan and state values are different (legitimate change)
370377
func determineSchemaNameForUpdate(planSchemaName, stateSchemaName types.String) *string {
378+
// Don't send schemaName to API if plan value is unknown.
379+
if planSchemaName.IsUnknown() {
380+
return nil
381+
}
382+
371383
// Only send schemaName to API if it differs from the remote state.
372384
if !planSchemaName.Equal(stateSchemaName) {
373385
return planSchemaName.ValueStringPointer()

0 commit comments

Comments
 (0)