Use unique dataset ids when testing routines (#1416)
Co-authored-by: Frank Bertsch <fbertsch@mozilla.com>
This commit is contained in:
Родитель
003f9a7090
Коммит
4840c18d6b
|
@ -2,6 +2,7 @@
|
|||
|
||||
from google.api_core.exceptions import BadRequest
|
||||
from google.cloud import bigquery
|
||||
import os
|
||||
import pytest
|
||||
import re
|
||||
|
||||
|
@ -91,7 +92,10 @@ class RoutineTest(pytest.Item):
|
|||
def runtest(self):
|
||||
"""Run Test."""
|
||||
bq = bigquery.Client()
|
||||
with dataset(bq, self.safe_name()) as default_dataset:
|
||||
dataset_id = self.safe_name()
|
||||
if "CIRCLE_BUILD_NUM" in os.environ:
|
||||
dataset_id += f"_{os.environ['CIRCLE_BUILD_NUM']}"
|
||||
with dataset(bq, dataset_id) as default_dataset:
|
||||
job_config = bigquery.QueryJobConfig(
|
||||
use_legacy_sql=False, default_dataset=default_dataset
|
||||
)
|
||||
|
|
Загрузка…
Ссылка в новой задаче