From 2d5c5a5d8ec99352afb12fd8bdebcd0b477fad08 Mon Sep 17 00:00:00 2001 From: CM Lubinski Date: Wed, 11 Oct 2023 12:19:47 -0400 Subject: [PATCH] Remove impersonation lifetime. (#882) * Remove impersonation lifetime. Per https://github.com/dbt-labs/dbt-bigquery/issues/769 , we shouldn't need to set the lifetime of an impersonated token. In some edge cases, attempting to set it to the job execution timeout (> 300 seconds) can result in authentication failures, even though the job will complete successfully and authentication creds will be correctly refreshed. * Changie data. --------- Co-authored-by: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Co-authored-by: Mike Alfare <13974384+mikealfare@users.noreply.github.com> --- .changes/unreleased/Fixes-20230817-095527.yaml | 6 ++++++ dbt/adapters/bigquery/connections.py | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20230817-095527.yaml diff --git a/.changes/unreleased/Fixes-20230817-095527.yaml b/.changes/unreleased/Fixes-20230817-095527.yaml new file mode 100644 index 000000000..34f1bf908 --- /dev/null +++ b/.changes/unreleased/Fixes-20230817-095527.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Avoid setting lifetime on impersonation tokens. +time: 2023-08-17T09:55:27.333914673-04:00 +custom: + Author: cmc333333 + Issue: "769" diff --git a/dbt/adapters/bigquery/connections.py b/dbt/adapters/bigquery/connections.py index ff544f0d0..132854748 100644 --- a/dbt/adapters/bigquery/connections.py +++ b/dbt/adapters/bigquery/connections.py @@ -356,7 +356,6 @@ def get_impersonated_credentials(cls, profile_credentials): source_credentials=source_credentials, target_principal=profile_credentials.impersonate_service_account, target_scopes=list(profile_credentials.scopes), - lifetime=(profile_credentials.job_execution_timeout_seconds or 300), ) @classmethod