forked from googleapis/python-bigquery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: address issues with concurrent BigQuery tests [(#3426)](GoogleCl…
…oudPlatform/python-docs-samples#3426) Co-authored-by: Leah E. Cole <[email protected]>
- Loading branch information
Showing
6 changed files
with
88 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
# limitations under the License. | ||
|
||
|
||
def run_authorized_view_tutorial(): | ||
def run_authorized_view_tutorial(override_values={}): | ||
# Note to user: This is a group email for testing purposes. Replace with | ||
# your own group email address when running this code. | ||
analyst_group_email = '[email protected]' | ||
|
@@ -28,6 +28,14 @@ def run_authorized_view_tutorial(): | |
client = bigquery.Client() | ||
source_dataset_id = 'github_source_data' | ||
|
||
# [END bigquery_authorized_view_tutorial] | ||
# [END bigquery_avt_create_source_dataset] | ||
# To facilitate testing, we replace values with alternatives | ||
# provided by the testing harness. | ||
source_dataset_id = override_values.get("source_dataset_id", source_dataset_id) | ||
# [START bigquery_authorized_view_tutorial] | ||
# [START bigquery_avt_create_source_dataset] | ||
|
||
source_dataset = bigquery.Dataset(client.dataset(source_dataset_id)) | ||
# Specify the geographic location where the dataset should reside. | ||
source_dataset.location = 'US' | ||
|
@@ -57,6 +65,15 @@ def run_authorized_view_tutorial(): | |
# Create a separate dataset to store your view | ||
# [START bigquery_avt_create_shared_dataset] | ||
shared_dataset_id = 'shared_views' | ||
|
||
# [END bigquery_authorized_view_tutorial] | ||
# [END bigquery_avt_create_shared_dataset] | ||
# To facilitate testing, we replace values with alternatives | ||
# provided by the testing harness. | ||
shared_dataset_id = override_values.get("shared_dataset_id", shared_dataset_id) | ||
# [START bigquery_authorized_view_tutorial] | ||
# [START bigquery_avt_create_shared_dataset] | ||
|
||
shared_dataset = bigquery.Dataset(client.dataset(shared_dataset_id)) | ||
shared_dataset.location = 'US' | ||
shared_dataset = client.create_dataset(shared_dataset) # API request | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters