diff --git a/CHANGELOG.md b/CHANGELOG.md index 562a46b4ca6..bd672ed05f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Fix unique_id generation for generic tests so tests with the same FQN but different configuration will run. ([#3254](https://github.com/fishtown-analytics/dbt/issues/3254), [#3335](https://github.com/fishtown-analytics/dbt/issues/3335)) - Update the snowflake adapter to only comment on a column if it exists when using the persist_docs config ([#3039](https://github.com/fishtown-analytics/dbt/issues/3039), [#3149](https://github.com/fishtown-analytics/dbt/pull/3149)) - Separate `compiled_path` from `build_path`, and print the former alongside node error messages ([#1985](https://github.com/fishtown-analytics/dbt/issues/1985), [#3327](https://github.com/fishtown-analytics/dbt/pull/3327)) +- Fix exception caused when running `dbt debug` with BigQuery connections ([#3314](https://github.com/fishtown-analytics/dbt/issues/3314), [#3351](https://github.com/fishtown-analytics/dbt/pull/3351)) ### Under the hood - Added logic for registry requests to raise a timeout error after a response hangs out for 30 seconds and 5 attempts have been made to reach the endpoint ([#3177](https://github.com/fishtown-analytics/dbt/issues/3177), [#3275](https://github.com/fishtown-analytics/dbt/pull/3275)) diff --git a/plugins/bigquery/dbt/adapters/bigquery/connections.py b/plugins/bigquery/dbt/adapters/bigquery/connections.py index e0140c38c01..137b02d4f48 100644 --- a/plugins/bigquery/dbt/adapters/bigquery/connections.py +++ b/plugins/bigquery/dbt/adapters/bigquery/connections.py @@ -309,7 +309,7 @@ def raw_execute(self, sql, fetch=False, *, use_legacy_sql=False): logger.debug('On {}: {}', conn.name, sql) - if self.profile.query_comment.job_label: + if self.profile.query_comment and self.profile.query_comment.job_label: query_comment = self.query_header.comment.query_comment labels = self._labels_from_query_comment(query_comment) else: diff --git a/test/integration/049_dbt_debug_test/test_debug.py b/test/integration/049_dbt_debug_test/test_debug.py index 8a5fbd774f3..74fabfcbc7b 100644 --- a/test/integration/049_dbt_debug_test/test_debug.py +++ b/test/integration/049_dbt_debug_test/test_debug.py @@ -64,6 +64,11 @@ def test_postgres_ok(self): self.run_dbt(['debug']) self.assertNotIn('ERROR', self.capsys.readouterr().out) + @use_profile('bigquery') + def test_bigquery_ok(self): + self.run_dbt(['debug']) + self.assertNotIn('ERROR', self.capsys.readouterr().out) + @use_profile('postgres') def test_postgres_nopass(self): self.run_dbt(['debug', '--target', 'nopass'], expect_pass=False)