Set project in init jobs (#4453)
This fixes https://github.com/mozilla/bigquery-etl/pull/4452
This commit is contained in:
Родитель
0171f93596
Коммит
7a36416554
|
@ -1327,10 +1327,10 @@ def initialize(name, sql_dir, project_id, dry_run):
|
|||
)
|
||||
else:
|
||||
init_files = Path(query_file.parent).rglob("init.sql")
|
||||
client = bigquery.Client()
|
||||
|
||||
for init_file in init_files:
|
||||
project = init_file.parent.parent.parent.name
|
||||
client = bigquery.Client(project=project)
|
||||
|
||||
with open(init_file) as init_file_stream:
|
||||
init_sql = init_file_stream.read()
|
||||
|
@ -1338,7 +1338,6 @@ def initialize(name, sql_dir, project_id, dry_run):
|
|||
job_config = bigquery.QueryJobConfig(
|
||||
dry_run=dry_run,
|
||||
default_dataset=f"{project}.{dataset}",
|
||||
project=project,
|
||||
)
|
||||
|
||||
if "CREATE MATERIALIZED VIEW" in init_sql:
|
||||
|
|
Загрузка…
Ссылка в новой задаче