Skip to content

Commit

Permalink
[#104] Ignore the Forbidden exception in `list_relations_without_ca…
Browse files Browse the repository at this point in the history
…ching` (#108)

* [#104] Ignore the forbidden exception in `list_relations_without_caching`

* Update CHANGELOG.md

* Further update CHANGELOG.md

Co-authored-by: Matthew McKnight <91097623+McKnight-42@users.noreply.github.com>
  • Loading branch information
yu-iskw and McKnight-42 authored Feb 7, 2022
1 parent 6f68dce commit 87095c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
- Fix test related to preventing coercion of boolean values (True, False) to numeric values (0, 1) in query results ([#93](https://github.com/dbt-labs/dbt-bigquery/issues/93))
- Add a check in `get_table_options` to check that the table has a `partition_by` in the config.
This will prevent BigQuery from throwing an error since non-partitioned tables cannot have `require_partition_filter` ([#107](https://github.com/dbt-labs/dbt-bigquery/issues/107))
- Ignore errors of the lack of permissions in `list_relations_without_caching` ([#104](https://github.com/dbt-labs/dbt-bigquery/issues/104))

### Under the hood
- Address BigQuery API deprecation warning and simplify usage of `TableReference` and `DatasetReference` objects ([#97](https://github.com/dbt-labs/dbt-bigquery/issues/97))

### Contributors
- [@hui-zheng](https://github.com/hui-zheng)([#50](https://github.com/dbt-labs/dbt-bigquery/pull/50))
- [@oliverrmaa](https://github.com/oliverrmaa)([#109](https://github.com/dbt-labs/dbt-bigquery/pull/109))
- [@yu-iskw](https://github.com/yu-iskw)([#108](https://github.com/dbt-labs/dbt-bigquery/pull/108))

## dbt-bigquery 1.0.0 (December 3, 2021)

Expand Down
3 changes: 3 additions & 0 deletions dbt/adapters/bigquery/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ def list_relations_without_caching(
return [self._bq_table_to_relation(table) for table in all_tables]
except google.api_core.exceptions.NotFound:
return []
except google.api_core.exceptions.Forbidden as exc:
logger.debug('list_relations_without_caching error: {}'.format(str(exc)))
return []

def get_relation(
self, database: str, schema: str, identifier: str
Expand Down

0 comments on commit 87095c4

Please sign in to comment.