diff --git a/bigquery/tests/system.py b/bigquery/tests/system.py index f234a431d51f..fd9efa7752cf 100644 --- a/bigquery/tests/system.py +++ b/bigquery/tests/system.py @@ -107,6 +107,11 @@ ), ] +# The VPC-SC team maintains a mirror of the GCS bucket used for code +# samples. The public bucket crosses the configured security boundary. +# See: https://github.com/googleapis/google-cloud-python/issues/8550 +SAMPLES_BUCKET = os.environ.get("GCLOUD_TEST_SAMPLES_BUCKET", "cloud-samples-data") + retry_storage_errors = RetryErrors( (TooManyRequests, InternalServerError, ServiceUnavailable) ) @@ -1877,7 +1882,9 @@ def test_create_routine(self): language="JAVASCRIPT", type_="SCALAR_FUNCTION", return_type=float64_type, - imported_libraries=["gs://cloud-samples-data/bigquery/udfs/max-value.js"], + imported_libraries=[ + "gs://{}/bigquery/udfs/max-value.js".format(SAMPLES_BUCKET) + ], ) routine.arguments = [ bigquery.RoutineArgument(