Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changes/unreleased/Fixes-20260803-132947.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: Fixes
body: 'Fix import/refresh of `bigquery_v1` `dbtcloud_global_connection` resources: `use_latest_adapter` is now derived from the API''s adapter version instead of being left unset, avoiding a false "Adapter version cannot be changed" error, and `timeout_seconds` (a `bigquery_v0`-only field) is no longer sent on update for `bigquery_v1` connections (#709).'
time: 2026-08-03T13:29:47.27689+03:00
8 changes: 8 additions & 0 deletions pkg/framework/objects/global_connection/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ func readGeneric(
state.Name = types.StringPointerValue(common.Name)
state.IsSshTunnelEnabled = types.BoolPointerValue(common.IsSshTunnelEnabled)

// derive use_latest_adapter from the adapter version returned by the API so that
// imported (and refreshed) bigquery_v1 connections round-trip correctly instead of
// leaving use_latest_adapter unset, which the resource's ModifyPlan guard then
// misreads as a user-requested adapter change
state.BigQueryConfig.UseLatestAdapter = types.BoolValue(
adapterVersion == bigqueryCfg.LatestAdapterVersion(),
)

// nullable common fields
if !common.PrivateLinkEndpointId.IsNull() {
state.PrivateLinkEndpointId = types.StringValue(common.PrivateLinkEndpointId.MustGet())
Expand Down
4 changes: 3 additions & 1 deletion pkg/framework/objects/global_connection/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,9 @@ func (r *globalConnectionResource) Update(
if plan.BigQueryConfig.GCPProjectID != state.BigQueryConfig.GCPProjectID {
warehouseConfigChanges.ProjectID = plan.BigQueryConfig.GCPProjectID.ValueStringPointer()
}
if plan.BigQueryConfig.TimeoutSeconds != state.BigQueryConfig.TimeoutSeconds {
// timeout_seconds is a bigquery_v0-only field; the API rejects it for bigquery_v1
if !plan.BigQueryConfig.UseLatestAdapter.ValueBool() &&
plan.BigQueryConfig.TimeoutSeconds != state.BigQueryConfig.TimeoutSeconds {
warehouseConfigChanges.TimeoutSeconds = plan.BigQueryConfig.TimeoutSeconds.ValueInt64Pointer()
}
if plan.BigQueryConfig.JobExecutionTimeoutSeconds != state.BigQueryConfig.JobExecutionTimeoutSeconds {
Expand Down
Loading