Skip to content

Commit 4d20929

Browse files
authored
fix: dry run fails when table/view/assertion already does not exsist (#1806)
1 parent 4b71bbf commit 4d20929

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

cli/api/commands/run.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ export class Runner {
365365
// (i.e. it must still be RUNNING, and not FAILED).
366366
actionResult.status === dataform.ActionResult.ExecutionStatus.RUNNING &&
367367
!(this.graph.runConfig && this.graph.runConfig.disableSetMetadata) &&
368+
!(this.executionOptions?.bigquery?.dryRun) &&
368369
action.type === "table"
369370
) {
370371
try {

cli/api/dbadapters/execution_sql.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ export class ExecutionSql {
4747
}
4848

4949
public insertInto(target: dataform.ITarget, columns: string[], query: string) {
50-
return `
51-
insert into ${this.resolveTarget(target)}
52-
(${columns.join(",")})
53-
select ${columns.join(",")}
50+
return `
51+
insert into ${this.resolveTarget(target)}
52+
(${columns.join(",")})
53+
select ${columns.join(",")}
5454
from (${query}) as insertions`;
5555
}
5656

@@ -174,7 +174,6 @@ from (${query}) as insertions`;
174174
const tasks = new Tasks();
175175
const target = assertion.target;
176176
tasks.add(Task.statement(this.createOrReplaceView(target, assertion.query)));
177-
tasks.add(Task.assertion(`select sum(1) as row_count from ${this.resolveTarget(target)}`));
178177
return tasks;
179178
}
180179

0 commit comments

Comments
 (0)