Skip to content

Commit

Permalink
Merge pull request #3351 from fishtown-analytics/fix/bigquery-debug-task
Browse files Browse the repository at this point in the history
Fix debug task for BigQuery connections
  • Loading branch information
Kyle Wigley authored May 14, 2021
2 parents 9693170 + 114ac07 commit 8ac5cdd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion plugins/bigquery/dbt/adapters/bigquery/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions test/integration/049_dbt_debug_test/test_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8ac5cdd

Please sign in to comment.