Skip to content

Commit

Permalink
fix debug task for bigquery connections
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Wigley committed May 12, 2021
1 parent d8c261f commit c370d79
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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 c370d79

Please sign in to comment.