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

Function validateNoMixedCompilationMode

core/utils.ts:251–280  ·  view source on GitHub ↗
(
  session: Session,
  filename: string,
  contextableQuery: Contextable<any, any>,
  contextableWhere: Contextable<any, any>,
  contextablePostOps: Array<Contextable<any, any>>,
  contextablePreOps: Array<Contextable<any, any>>
)

Source from the content-addressed store, hash-verified

249}
250
251export function validateNoMixedCompilationMode(
252 session: Session,
253 filename: string,
254 contextableQuery: Contextable<any, any>,
255 contextableWhere: Contextable<any, any>,
256 contextablePostOps: Array<Contextable<any, any>>,
257 contextablePreOps: Array<Contextable<any, any>>
258) {
259 let flattenPostOps: unknown[] = [];
260 contextablePostOps.forEach(op => {
261 flattenPostOps = flattenPostOps.concat(typeof op === "object" ? op : [op]);
262 });
263 let flattenPreOps: unknown[] = [];
264 contextablePreOps.forEach(op => {
265 flattenPreOps = flattenPreOps.concat(typeof op === "object" ? op : [op]);
266 });
267 const conflictingProperties: string[] = [];
268 if (!!contextableQuery) { conflictingProperties.push("query"); }
269 if (!!contextableWhere) { conflictingProperties.push("where"); }
270 if (!!flattenPostOps.length) { conflictingProperties.push("postOps"); }
271 if (!!flattenPreOps.length) { conflictingProperties.push("preOps"); }
272 if (conflictingProperties.length) {
273 const err = new Error(
274 `Cannot mix AoT and JiT compilation in action. The following AoT properties were found: ${conflictingProperties.join(", ")
275 }`
276 );
277 session.compileError(err, filename);
278 throw err;
279 }
280}
281
282/**
283 * Checks if the Cloud Resource connection has a valid format.

Callers 4

utils_test.tsFile · 0.90
compileJitMethod · 0.90
compileJitMethod · 0.90
compileJitMethod · 0.90

Calls 2

compileErrorMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected