Skip to content

Commit

Permalink
fix: dry run fails when table/view/assertion already does not exsist (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish10alex authored Sep 5, 2024
1 parent 4b71bbf commit 4d20929
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions cli/api/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ export class Runner {
// (i.e. it must still be RUNNING, and not FAILED).
actionResult.status === dataform.ActionResult.ExecutionStatus.RUNNING &&
!(this.graph.runConfig && this.graph.runConfig.disableSetMetadata) &&
!(this.executionOptions?.bigquery?.dryRun) &&
action.type === "table"
) {
try {
Expand Down
9 changes: 4 additions & 5 deletions cli/api/dbadapters/execution_sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ export class ExecutionSql {
}

public insertInto(target: dataform.ITarget, columns: string[], query: string) {
return `
insert into ${this.resolveTarget(target)}
(${columns.join(",")})
select ${columns.join(",")}
return `
insert into ${this.resolveTarget(target)}
(${columns.join(",")})
select ${columns.join(",")}
from (${query}) as insertions`;
}

Expand Down Expand Up @@ -174,7 +174,6 @@ from (${query}) as insertions`;
const tasks = new Tasks();
const target = assertion.target;
tasks.add(Task.statement(this.createOrReplaceView(target, assertion.query)));
tasks.add(Task.assertion(`select sum(1) as row_count from ${this.resolveTarget(target)}`));
return tasks;
}

Expand Down

0 comments on commit 4d20929

Please sign in to comment.