MCPcopy Create free account
hub / github.com/dataform-co/dataform / build

Method build

cli/api/commands/build.ts:45–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 }
44
45 public build(): dataform.ExecutionGraph {
46 if (utils.graphHasErrors(this.prunedGraph)) {
47 throw new Error(`Project has unresolved compilation or validation errors.`);
48 }
49
50 const tableMetadataByTarget = new Map<string, dataform.ITableMetadata>();
51
52 this.warehouseState.tables.forEach(tableState => {
53 tableMetadataByTarget.set(targetStringifier.stringify(tableState.target), tableState);
54 });
55
56 const actions: dataform.IExecutionAction[] = [].concat(
57 this.prunedGraph.tables.map(t =>
58 this.buildTable(
59 t,
60 tableMetadataByTarget.get(targetStringifier.stringify(t.target)),
61 this.runConfig
62 )
63 ),
64 this.prunedGraph.operations.map(o => this.buildOperation(o)),
65 this.prunedGraph.assertions.map(a => this.buildAssertion(a))
66 );
67 return dataform.ExecutionGraph.create({
68 projectConfig: this.prunedGraph.projectConfig,
69 runConfig: this.runConfig,
70 warehouseState: this.warehouseState,
71 declarationTargets: this.prunedGraph.declarations.map(declaration => declaration.target),
72 actions
73 });
74 }
75
76 private buildTable(
77 table: dataform.ITable,

Callers 1

buildFunction · 0.45

Calls 7

buildTableMethod · 0.95
buildOperationMethod · 0.95
buildAssertionMethod · 0.95
stringifyMethod · 0.80
getMethod · 0.80
createMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected