Avoid table stage deploy when there are no queries (#5269)
This commit is contained in:
Родитель
718dd0e391
Коммит
0bc2dd1cba
|
@ -363,29 +363,30 @@ def _deploy_artifacts(ctx, artifact_files, project_id, dataset_suffix, sql_dir):
|
|||
and "*" not in file.parent.name and file.parent.name != "INFORMATION_SCHEMA"
|
||||
]
|
||||
|
||||
# checking and creating datasets needs to happen sequentially
|
||||
for query_file in query_files:
|
||||
dataset = query_file.parent.parent.name
|
||||
create_dataset_if_not_exists(
|
||||
project_id=project_id, dataset=dataset, suffix=dataset_suffix
|
||||
)
|
||||
if len(query_files) > 0:
|
||||
# checking and creating datasets needs to happen sequentially
|
||||
for query_file in query_files:
|
||||
dataset = query_file.parent.parent.name
|
||||
create_dataset_if_not_exists(
|
||||
project_id=project_id, dataset=dataset, suffix=dataset_suffix
|
||||
)
|
||||
|
||||
ctx.invoke(
|
||||
update_query_schema,
|
||||
name=query_files,
|
||||
sql_dir=sql_dir,
|
||||
project_id=project_id,
|
||||
respect_dryrun_skip=True,
|
||||
)
|
||||
ctx.invoke(
|
||||
deploy_query_schema,
|
||||
name=query_files,
|
||||
sql_dir=sql_dir,
|
||||
project_id=project_id,
|
||||
force=True,
|
||||
respect_dryrun_skip=False,
|
||||
skip_external_data=True,
|
||||
)
|
||||
ctx.invoke(
|
||||
update_query_schema,
|
||||
name=query_files,
|
||||
sql_dir=sql_dir,
|
||||
project_id=project_id,
|
||||
respect_dryrun_skip=True,
|
||||
)
|
||||
ctx.invoke(
|
||||
deploy_query_schema,
|
||||
name=query_files,
|
||||
sql_dir=sql_dir,
|
||||
project_id=project_id,
|
||||
force=True,
|
||||
respect_dryrun_skip=False,
|
||||
skip_external_data=True,
|
||||
)
|
||||
|
||||
# deploy views
|
||||
view_files = [
|
||||
|
|
|
@ -109,7 +109,8 @@ def paths_matching_name_pattern(
|
|||
if pattern is None:
|
||||
pattern = "*.*"
|
||||
|
||||
if isinstance(pattern, list):
|
||||
# click nargs are passed in as a tuple
|
||||
if isinstance(pattern, tuple) or isinstance(pattern, list):
|
||||
for p in pattern:
|
||||
matching_files += paths_matching_name_pattern(
|
||||
str(p), sql_path, project_id, files, file_regex
|
||||
|
|
Загрузка…
Ссылка в новой задаче