Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/issue 104 #111

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f56a7d8
[#104] Ignore the forbidden exception in `list_relations_without_cach…
yu-iskw Jan 25, 2022
20f8cd8
Update CHANGELOG.md
yu-iskw Jan 25, 2022
f0c3c83
Further update CHANGELOG.md
yu-iskw Jan 25, 2022
e91aacf
sending test up to be checked by kyle
McKnight-42 Jan 31, 2022
eeb0c59
updating changelog
McKnight-42 Feb 1, 2022
9c4ecf0
removed unneeded import
McKnight-42 Feb 1, 2022
ecba53c
first possible version to test database failure
McKnight-42 Feb 2, 2022
24ba9ab
continued iteration on test (having to use DatabaseExceptions would p…
McKnight-42 Feb 2, 2022
15d1be5
Merge branch 'main' of https://github.com/dbt-labs/dbt-bigquery into …
McKnight-42 Feb 7, 2022
c862f8f
adding env var to integration.yml
McKnight-42 Feb 7, 2022
418ad7c
updating formatting
McKnight-42 Feb 7, 2022
5f4a932
trying to update to make env_var work and not error out
McKnight-42 Feb 7, 2022
2d02b72
retrying test
McKnight-42 Feb 7, 2022
5ca9dbf
fine tuning env var error
McKnight-42 Feb 7, 2022
3151755
removing env from integration.yml, to add to seperate pr
McKnight-42 Feb 8, 2022
271eb11
Merge branch 'main' of https://github.com/dbt-labs/dbt-bigquery into …
McKnight-42 Feb 11, 2022
c8f88c1
Merge branch 'main' into test/issue-104
McKnight-42 Feb 11, 2022
351b90f
Merge branch 'main' of https://github.com/dbt-labs/dbt-bigquery into …
McKnight-42 Feb 22, 2022
6ab5cec
adding docstring and small comment on why we use the exception we do
McKnight-42 Feb 22, 2022
2a1d945
Merge branch 'test/issue-104' of https://github.com/dbt-labs/dbt-bigq…
McKnight-42 Feb 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixes
- 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))
- Ignore errors of the lack of permissions in `list_relations_without_caching` ([#104](https://github.com/dbt-labs/dbt-bigquery/issues/104))
- 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))
Expand All @@ -16,6 +17,7 @@ This will prevent BigQuery from throwing an error since non-partitioned tables c
- [@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)

## dbt-bigquery 1.0.0rc2 (November 24, 2021)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ config(project = env_var('BIGQUERY_TEST_NO_ACCESS_DATABASE')) }}

select 1 as id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select 1 as id
29 changes: 29 additions & 0 deletions tests/integration/bigquery_test/test_no_access.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from tests.integration.base import DBTIntegrationTest, use_profile
import dbt.exceptions


class TestNoAccess(DBTIntegrationTest):

@property
def schema(self):
return 'no_access_models'

@property
def models(self):
return "no-access-models"

@use_profile('bigquery')
def test_bigquery_no_access(self):
"""tests error exceptions against project user doesn't have access to."""
results = self.run_dbt(['run','--exclude','model_1'])
self.assertEqual(len(results), 1)
results = self.run_dbt(['run','--select','model_2'])
self.assertEqual(len(results), 1)
try:
results = self.run_dbt(['run','--select','model_1'])
except dbt.exceptions.DatabaseException:
# have to test against DatabaseException as run_dbt catches warehouse thorwn error and genreralizes it to dbt version.
is_false = True
self.assertTrue(is_false)
self.assertRaises(dbt.exceptions.DatabaseException)