From aa7bea8dbe4cdca0d6f98b3502083d2c677af116 Mon Sep 17 00:00:00 2001 From: Mila Page <67295367+VersusFacit@users.noreply.github.com> Date: Wed, 7 Jun 2023 09:57:03 -0700 Subject: [PATCH] Standardize the adapter for core debug changes. (#754) * Standardize the adapter for core debug changes. * add changelog * Tweak fields --------- Co-authored-by: Mila Page --- .changes/unreleased/Features-20230604-034603.yaml | 6 ++++++ dbt/adapters/bigquery/connections.py | 15 +++++++++++++-- dbt/adapters/bigquery/impl.py | 4 ++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/Features-20230604-034603.yaml diff --git a/.changes/unreleased/Features-20230604-034603.yaml b/.changes/unreleased/Features-20230604-034603.yaml new file mode 100644 index 000000000..a1eebc327 --- /dev/null +++ b/.changes/unreleased/Features-20230604-034603.yaml @@ -0,0 +1,6 @@ +kind: Features +body: Standardize the _connection_keys and debug_query for `dbt debug`. +time: 2023-06-04T03:46:03.065575-07:00 +custom: + Author: versusfacit + Issue: PR754 diff --git a/dbt/adapters/bigquery/connections.py b/dbt/adapters/bigquery/connections.py index 47acceda9..c9c6055ac 100644 --- a/dbt/adapters/bigquery/connections.py +++ b/dbt/adapters/bigquery/connections.py @@ -169,17 +169,28 @@ def _connection_keys(self): return ( "method", "database", + "execution_project", "schema", "location", "priority", - "timeout_seconds", "maximum_bytes_billed", - "execution_project", + "impersonate_service_account", "job_retry_deadline_seconds", "job_retries", "job_creation_timeout_seconds", "job_execution_timeout_seconds", + "keyfile", + "keyfile_json", + "timeout_seconds", + "token", + "refresh_token", + "client_id", + "client_secret", + "token_uri", + "dataproc_region", + "dataproc_cluster_name", "gcs_bucket", + "dataproc_batch", ) @classmethod diff --git a/dbt/adapters/bigquery/impl.py b/dbt/adapters/bigquery/impl.py index cad7d0072..f5a369ffc 100644 --- a/dbt/adapters/bigquery/impl.py +++ b/dbt/adapters/bigquery/impl.py @@ -978,3 +978,7 @@ def render_model_constraint(cls, constraint: ModelLevelConstraint) -> Optional[s return f"{c} not enforced" if c else None return c + + def debug_query(self): + """Override for DebugTask method""" + self.execute("select 1 as id")