Skip to content

Commit

Permalink
updates tutorial to add datasets to to_delete before running (GoogleC…
Browse files Browse the repository at this point in the history
  • Loading branch information
alixhami authored Jul 17, 2018
1 parent a28eca0 commit f83bb36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion bigquery/cloud-client/authorized_view_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def run_authorized_view_tutorial():
source_dataset, ['access_entries']) # API request
# [END bigquery_avt_source_dataset_access]
# [END bigquery_authorized_view_tutorial]
return (source_dataset, shared_dataset)


if __name__ == '__main__':
Expand Down
10 changes: 7 additions & 3 deletions bigquery/cloud-client/authorized_view_tutorial_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ def to_delete(client):


def test_authorized_view_tutorial(client, to_delete):
source_dataset, shared_dataset = (
authorized_view_tutorial.run_authorized_view_tutorial())
to_delete.extend([source_dataset, shared_dataset])
source_dataset_ref = client.dataset('github_source_data')
shared_dataset_ref = client.dataset('shared_views')
to_delete.extend([source_dataset_ref, shared_dataset_ref])

authorized_view_tutorial.run_authorized_view_tutorial()

source_dataset = client.get_dataset(source_dataset_ref)
shared_dataset = client.get_dataset(shared_dataset_ref)
analyst_email = '[email protected]'
analyst_entries = [entry for entry in shared_dataset.access_entries
if entry.entity_id == analyst_email]
Expand Down

0 comments on commit f83bb36

Please sign in to comment.