@dataform/core
Advanced tools
Comparing version 1.2.5 to 1.3.0
@@ -71,3 +71,3 @@ (function (factory) { | ||
if (!registry[projectConfig.warehouse]) { | ||
throw Error(`Unsupported warehouse: ${projectConfig.warehouse}`); | ||
throw new Error(`Unsupported warehouse: ${projectConfig.warehouse}`); | ||
} | ||
@@ -83,2 +83,2 @@ return new registry[projectConfig.warehouse](projectConfig); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9jb3JlL2FkYXB0ZXJzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0lBQUEsK0RBQW1FO0lBQ25FLCtEQUFtRTtJQUNuRSxpRUFBcUU7SUFDckUsK0VBQW1GO0lBc0JuRixJQUFZLGFBTVg7SUFORCxXQUFZLGFBQWE7UUFDdkIsc0NBQXFCLENBQUE7UUFDckIsc0NBQXFCLENBQUE7UUFDckIsc0NBQXFCLENBQUE7UUFDckIsd0NBQXVCLENBQUE7UUFDdkIsc0RBQXFDLENBQUE7SUFDdkMsQ0FBQyxFQU5XLGFBQWEsR0FBYixxQkFBYSxLQUFiLHFCQUFhLFFBTXhCO0lBRUQsTUFBTSxzQkFBc0IsR0FBRyxDQUFDLGFBQWEsQ0FBQyxRQUFRLEVBQUUsYUFBYSxDQUFDLGdCQUFnQixDQUFDLENBQUM7SUFFeEYsU0FBZ0IsY0FBYyxDQUFDLGFBQTRCO1FBQ3pELE9BQU8sc0JBQXNCLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFO1lBQ3JDLE9BQU8sQ0FBQyxLQUFLLGFBQWEsQ0FBQztRQUM3QixDQUFDLENBQUMsQ0FBQztJQUNMLENBQUM7SUFKRCx3Q0FJQztJQUVELE1BQU0sOEJBQThCLEdBQW9DO1FBQ3RFLFdBQV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klQcm9qZWN0Q29uZmlnKTogSUFkYXB0ZXIge1xuICBpZiAoIXJlZ2lzdHJ5W3Byb2plY3RDb25maWcud2FyZWhvdXNlXSkge1xuICAgIHRocm93IG5ldyBFcnJvcihgVW5zdXBwb3J0ZWQgd2FyZWhvdXNlOiAke3Byb2plY3RDb25maWcud2FyZWhvdXNlfWApO1xuICB9XG4gIHJldHVybiBuZXcgcmVnaXN0cnlbcHJvamVjdENvbmZpZy53YXJlaG91c2VdKHByb2plY3RDb25maWcpO1xufVxuXG5yZWdpc3RlcihcImJpZ3F1ZXJ5XCIsIEJpZ1F1ZXJ5QWRhcHRlcik7XG4vLyBUT0RPOiBUaGUgcmVkc2hpZnQgY2xpZW50IGxpYnJhcnkgaGFwcGVucyB0byB3b3JrIHdlbGwgZm9yIHBvc3RncmVzLCBidXQgd2Ugc2hvdWxkIHByb2JhYmx5XG4vLyBub3QgYmUgcmVseWluZyBvbiB0aGF0IGJlaGF2aW91ci4gQXQgc29tZSBwb2ludCB3ZSBzaG91bGQgcmVwbGFjZSB0aGlzIHdpdGggYSBmaXJzdC1jbGFzc1xuLy8gUG9zdGdyZXNBZGFwdGVyLlxucmVnaXN0ZXIoXCJwb3N0Z3Jlc1wiLCBSZWRzaGlmdEFkYXB0ZXIpO1xucmVnaXN0ZXIoXCJyZWRzaGlmdFwiLCBSZWRzaGlmdEFkYXB0ZXIpO1xucmVnaXN0ZXIoXCJzbm93Zmxha2VcIiwgU25vd2ZsYWtlQWRhcHRlcik7XG5yZWdpc3RlcihcInNxbGRhdGF3YXJlaG91c2VcIiwgU1FMRGF0YVdhcmVob3VzZUFkYXB0ZXIpO1xuIl19 |
/// <amd-module name="@dataform/core/assertion" /> | ||
import { Session } from "@dataform/core/session"; | ||
import { Resolvable, Session } from "@dataform/core/session"; | ||
import { dataform } from "@dataform/protos"; | ||
export declare type AContextable<T> = T | ((ctx: AssertionContext) => T); | ||
export interface AConfig { | ||
dependencies?: string | string[]; | ||
dependencies?: Resolvable | Resolvable[]; | ||
tags?: string[]; | ||
@@ -17,6 +17,6 @@ description?: string; | ||
query(query: AContextable<string>): this; | ||
dependencies(value: string | string[]): this; | ||
dependencies(value: Resolvable | Resolvable[]): this; | ||
tags(value: string | string[]): this; | ||
description(description: string): this; | ||
schema(schema: string): void; | ||
schema(schema: string): this; | ||
compile(): dataform.IAssertion; | ||
@@ -27,7 +27,7 @@ } | ||
constructor(assertion: Assertion); | ||
ref(name: string): string; | ||
resolve(name: string): string; | ||
dependencies(name: string | string[]): string; | ||
ref(ref: Resolvable): string; | ||
resolve(ref: Resolvable): string; | ||
dependencies(name: Resolvable | Resolvable[]): string; | ||
tags(name: string | string[]): string; | ||
apply<T>(value: AContextable<T>): T; | ||
} |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define("@dataform/core/assertion", ["require", "exports", "@dataform/protos"], factory); | ||
define("@dataform/core/assertion", ["require", "exports", "@dataform/core/utils", "@dataform/protos"], factory); | ||
} | ||
@@ -13,2 +13,3 @@ })(function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const utils = require("@dataform/core/utils"); | ||
const protos_1 = require("@dataform/protos"); | ||
@@ -39,6 +40,7 @@ class Assertion { | ||
dependencies(value) { | ||
const newDependencies = typeof value === "string" ? [value] : value; | ||
newDependencies.forEach(d => { | ||
if (this.proto.dependencies.indexOf(d) < 0) { | ||
this.proto.dependencies.push(d); | ||
const newDependencies = utils.isResolvable(value) ? [value] : value; | ||
newDependencies.forEach((d) => { | ||
const depName = utils.appendSuffixToSchema(d, this.session.getSuffixWithUnderscore()); | ||
if (this.proto.dependencies.indexOf(depName) < 0) { | ||
this.proto.dependencies.push(depName); | ||
} | ||
@@ -62,3 +64,6 @@ }); | ||
schema(schema) { | ||
this.proto.target = this.session.target(schema, this.session.config.assertionSchema); | ||
if (schema !== this.session.config.assertionSchema) { | ||
this.session.setNameAndTarget(this.proto, this.proto.target.name, schema); | ||
} | ||
return this; | ||
} | ||
@@ -77,8 +82,9 @@ compile() { | ||
} | ||
ref(name) { | ||
ref(ref) { | ||
const name = typeof ref === "string" || typeof ref === "undefined" ? ref : `${ref.schema}.${ref.name}`; | ||
this.assertion.dependencies(name); | ||
return this.resolve(name); | ||
return this.resolve(ref); | ||
} | ||
resolve(name) { | ||
return this.assertion.session.resolve(name); | ||
resolve(ref) { | ||
return this.assertion.session.resolve(ref); | ||
} | ||
@@ -104,2 +110,2 @@ dependencies(name) { | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXJ0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vY29yZS9hc3NlcnRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7SUFDQSw2Q0FBNEM7SUFXNUMsTUFBYSxTQUFTO1FBQXRCO1lBQ1MsVUFBSyxHQUF3QixpQkFBUSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQWtFbEUsQ0FBQztRQTFEUSxNQUFNLENBQUMsTUFBZTtZQUMzQixJQUFJLE1BQU0sQ0FBQyxZQUFZLEVBQUU7Z0JBQ3ZCLElBQUksQ0FBQyxZQUFZLENBQUMsTUFBTSxDQUFDLFlBQVksQ0FBQyxDQUFDO2FBQ3hDO1lBQ0QsSUFBSSxNQUFNLENBQUMsSUFBSSxFQUFFO2dCQUNmLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQ3hCO1lBQ0QsSUFBSSxNQUFNLENBQUMsV0FBVyxFQUFFO2dCQUN0QixJQUFJLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxXQUFXLENBQUMsQ0FBQzthQUN0QztZQUNELElBQUksTUFBTSxDQUFDLE1BQU0sRUFBRTtnQkFDakIsSUFBSSxDQUFDLE1BQU0sQ0FBQ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zZXJ0aW9uID0gYXNzZXJ0aW9uO1xuICB9XG5cbiAgcHVibGljIHJlZihyZWY6IFJlc29sdmFibGUpIHtcbiAgICBjb25zdCBuYW1lID1cbiAgICAgIHR5cGVvZiByZWYgPT09IFwic3RyaW5nXCIgfHwgdHlwZW9mIHJlZiA9PT0gXCJ1bmRlZmluZWRcIiA/IHJlZiA6IGAke3JlZi5zY2hlbWF9LiR7cmVmLm5hbWV9YDtcbiAgICB0aGlzLmFzc2VydGlvbi5kZXBlbmRlbmNpZXMobmFtZSk7XG4gICAgcmV0dXJuIHRoaXMucmVzb2x2ZShyZWYpO1xuICB9XG5cbiAgcHVibGljIHJlc29sdmUocmVmOiBSZXNvbHZhYmxlKSB7XG4gICAgcmV0dXJuIHRoaXMuYXNzZXJ0aW9uLnNlc3Npb24ucmVzb2x2ZShyZWYpO1xuICB9XG5cbiAgcHVibGljIGRlcGVuZGVuY2llcyhuYW1lOiBSZXNvbHZhYmxlIHwgUmVzb2x2YWJsZVtdKSB7XG4gICAgdGhpcy5hc3NlcnRpb24uZGVwZW5kZW5jaWVzKG5hbWUpO1xuICAgIHJldHVybiBcIlwiO1xuICB9XG4gIHB1YmxpYyB0YWdzKG5hbWU6IHN0cmluZyB8IHN0cmluZ1tdKSB7XG4gICAgdGhpcy5hc3NlcnRpb24udGFncyhuYW1lKTtcbiAgICByZXR1cm4gXCJcIjtcbiAgfVxuXG4gIHB1YmxpYyBhcHBseTxUPih2YWx1ZTogQUNvbnRleHRhYmxlPFQ+KTogVCB7XG4gICAgaWYgKHR5cGVvZiB2YWx1ZSA9PT0gXCJmdW5jdGlvblwiKSB7XG4gICAgICByZXR1cm4gKHZhbHVlIGFzIGFueSkodGhpcyk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG4gIH1cbn1cbiJdfQ== |
@@ -117,3 +117,5 @@ (function (factory) { | ||
action.query(ctx => { | ||
${["self", "ref", "resolve", "name"].map(name => `const ${name} = ctx.${name}.bind(ctx);`).join("\n")} | ||
${["self", "ref", "resolve", "name"] | ||
.map(name => `const ${name} = ctx.${name}.bind(ctx);`) | ||
.join("\n")} | ||
${results.js} | ||
@@ -145,3 +147,5 @@ if (hasIncremental) { | ||
action.queries(ctx => { | ||
${["self", "ref", "resolve", "name"].map(name => `const ${name} = ctx.${name}.bind(ctx);`).join("\n")} | ||
${["self", "ref", "resolve", "name"] | ||
.map(name => `const ${name} = ctx.${name}.bind(ctx);`) | ||
.join("\n")} | ||
${results.js} | ||
@@ -153,2 +157,5 @@ const operations = [${results.sql.map(sql => `\`${sql}\``)}]; | ||
} | ||
case "declaration": { | ||
break; | ||
} | ||
case "test": { | ||
@@ -187,2 +194,2 @@ ${Object.keys(results.input).map(inputLabel => ` | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZXJzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vY29yZS9jb21waWxlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7SUFBQSx3REFBNEQ7SUFDNUQsd0RBQTREO0lBQzVELDREQUEwRTtJQUMxRSxnREFBb0Q7SUFDcEQsOENBQThDO0lBRTlDLFNBQWdCLE9BQU8sQ0FBQyxJQUFZLEVBQUUsSUFBWTtRQUNoRCxJQUFJLElBQUksQ0FBQyxRQUFRLENBQUMsT0FBTyxDQUFDLEVBQUU7WUFDMUIsT0FBTyxXQUFXLENBQUMsdUJBQVMsQ0FBQyxJQUFJLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FBQztTQUMzQztRQUNELElBQUksSUFBSSxDQUFDLFFBQVEsQ0FBQyxhQUFhLENBQUMsRUFBRTtZQUNoQyxPQUFPLG1CQUFtQixDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztTQUN4QztRQUNELElBQUksSUFBSSxDQUFDLFFBQVEsQ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nB1dExhYmVsID0+XG4gICAgICAgIGBcbiAgICAgICAgYWN0aW9uLmlucHV0KFwiJHtpbnB1dExhYmVsfVwiLCBjdHggPT4ge1xuICAgICAgICAgICR7cmVzdWx0cy5qc31cbiAgICAgICAgICByZXR1cm4gXFxgJHtyZXN1bHRzLmlucHV0W2lucHV0TGFiZWxdfVxcYDtcbiAgICAgICAgfSk7XG4gICAgICAgIGBcbiAgICApfVxuICAgIGFjdGlvbi5leHBlY3QoY3R4ID0+IHtcbiAgICAgICR7cmVzdWx0cy5qc31cbiAgICAgIHJldHVybiBcXGAke3Jlc3VsdHMuc3FsfVxcYDtcbiAgICB9KTtcbiAgICBicmVhaztcbiAgfVxuICBkZWZhdWx0OiB7XG4gICAgc2Vzc2lvbi5jb21waWxlRXJyb3IobmV3IEVycm9yKFxcYFVucmVjb2duaXplZCBhY3Rpb24gdHlwZTogXFwke3NxbHhDb25maWcudHlwZX1cXGApKTtcbiAgICBicmVhaztcbiAgfVxufWA7XG59XG5cbmZ1bmN0aW9uIGdldEZ1bmN0aW9uUHJvcGVydHlOYW1lcyhwcm90b3R5cGU6IGFueSkge1xuICByZXR1cm4gW1xuICAgIC4uLm5ldyBTZXQoXG4gICAgICBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhwcm90b3R5cGUpLmZpbHRlcihwcm9wZXJ0eU5hbWUgPT4ge1xuICAgICAgICBpZiAodHlwZW9mIHByb3RvdHlwZVtwcm9wZXJ0eU5hbWVdICE9PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHByb3BlcnR5TmFtZSA9PT0gXCJjb25zdHJ1Y3RvclwiKSB7XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfSlcbiAgICApXG4gIF07XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2Z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FrO1xuICB9XG4gIGRlZmF1bHQ6IHtcbiAgICBzZXNzaW9uLmNvbXBpbGVFcnJvcihuZXcgRXJyb3IoXFxgVW5yZWNvZ25pemVkIGFjdGlvbiB0eXBlOiBcXCR7c3FseENvbmZpZy50eXBlfVxcYCkpO1xuICAgIGJyZWFrO1xuICB9XG59YDtcbn1cblxuZnVuY3Rpb24gZ2V0RnVuY3Rpb25Qcm9wZXJ0eU5hbWVzKHByb3RvdHlwZTogYW55KSB7XG4gIHJldHVybiBbXG4gICAgLi4ubmV3IFNldChcbiAgICAgIE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKHByb3RvdHlwZSkuZmlsdGVyKHByb3BlcnR5TmFtZSA9PiB7XG4gICAgICAgIGlmICh0eXBlb2YgcHJvdG90eXBlW3Byb3BlcnR5TmFtZV0gIT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocHJvcGVydHlOYW1lID09PSBcImNvbnN0cnVjdG9yXCIpIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9KVxuICAgIClcbiAgXTtcbn1cbiJdfQ== |
@@ -41,4 +41,5 @@ (function (factory) { | ||
global.assert = session.assert.bind(session); | ||
global.declare = session.declare.bind(session); | ||
global.test = session.test.bind(session); | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9jb3JlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0lBQUEsMERBQW9EO0lBUzNDLDRCQUFRO0lBUmpCLHNEQUFzRDtJQUN0RCx3REFBb0Q7SUFDcEQsb0RBQWlEO0lBSXBDLFFBQUEsa0J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FueSkuZGVjbGFyZSA9IHNlc3Npb24uZGVjbGFyZS5iaW5kKHNlc3Npb24pO1xuKGdsb2JhbCBhcyBhbnkpLnRlc3QgPSBzZXNzaW9uLnRlc3QuYmluZChzZXNzaW9uKTtcbiJdfQ== |
/// <amd-module name="@dataform/core/operation" /> | ||
import { IColumnsDescriptor, Session } from "@dataform/core/session"; | ||
import { IColumnsDescriptor, Resolvable, Session } from "@dataform/core/session"; | ||
import { dataform } from "@dataform/protos"; | ||
export declare type OContextable<T> = T | ((ctx: OperationContext) => T); | ||
export interface OConfig { | ||
dependencies?: string | string[]; | ||
dependencies?: Resolvable | Resolvable[]; | ||
tags?: string[]; | ||
@@ -19,3 +19,3 @@ description?: string; | ||
queries(queries: OContextable<string | string[]>): this; | ||
dependencies(value: string | string[]): this; | ||
dependencies(value: Resolvable | Resolvable[]): this; | ||
tags(value: string | string[]): this; | ||
@@ -25,3 +25,3 @@ hasOutput(hasOutput: boolean): this; | ||
columns(columns: IColumnsDescriptor): this; | ||
schema(schema: string): void; | ||
schema(schema: string): this; | ||
compile(): dataform.IOperation; | ||
@@ -34,5 +34,5 @@ } | ||
name(): string; | ||
ref(name: string): string; | ||
resolve(name: string): string; | ||
dependencies(name: string | string[]): string; | ||
ref(ref: Resolvable): string; | ||
resolve(ref: Resolvable): string; | ||
dependencies(name: Resolvable | Resolvable[]): string; | ||
tags(name: string | string[]): string; | ||
@@ -39,0 +39,0 @@ hasOutput(hasOutput: boolean): string; |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define("@dataform/core/operation", ["require", "exports", "@dataform/core/session", "@dataform/protos"], factory); | ||
define("@dataform/core/operation", ["require", "exports", "@dataform/core/session", "@dataform/core/utils", "@dataform/protos"], factory); | ||
} | ||
@@ -14,2 +14,3 @@ })(function (require, exports) { | ||
const session_1 = require("@dataform/core/session"); | ||
const utils = require("@dataform/core/utils"); | ||
const protos_1 = require("@dataform/protos"); | ||
@@ -46,6 +47,7 @@ class Operation { | ||
dependencies(value) { | ||
const newDependencies = typeof value === "string" ? [value] : value; | ||
newDependencies.forEach(d => { | ||
if (this.proto.dependencies.indexOf(d) < 0) { | ||
this.proto.dependencies.push(d); | ||
const newDependencies = utils.isResolvable(value) ? [value] : value; | ||
newDependencies.forEach((d) => { | ||
const depName = utils.appendSuffixToSchema(d, this.session.getSuffixWithUnderscore()); | ||
if (this.proto.dependencies.indexOf(depName) < 0) { | ||
this.proto.dependencies.push(depName); | ||
} | ||
@@ -83,3 +85,6 @@ }); | ||
schema(schema) { | ||
this.proto.target = this.session.target(schema); | ||
if (schema !== this.session.config.defaultSchema) { | ||
this.session.setNameAndTarget(this.proto, this.proto.target.name, schema); | ||
} | ||
return this; | ||
} | ||
@@ -105,13 +110,17 @@ compile() { | ||
self() { | ||
return this.resolve(this.operation.proto.name); | ||
return this.resolve({ | ||
schema: this.operation.proto.target.schema, | ||
name: this.operation.proto.target.name | ||
}); | ||
} | ||
name() { | ||
return this.operation.proto.name; | ||
return this.operation.proto.target.name; | ||
} | ||
ref(name) { | ||
ref(ref) { | ||
const name = typeof ref === "string" || typeof ref === "undefined" ? ref : `${ref.schema}.${ref.name}`; | ||
this.operation.dependencies(name); | ||
return this.resolve(name); | ||
return this.resolve(ref); | ||
} | ||
resolve(name) { | ||
return this.operation.session.resolve(name); | ||
resolve(ref) { | ||
return this.operation.session.resolve(ref); | ||
} | ||
@@ -141,2 +150,2 @@ dependencies(name) { | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3BlcmF0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vY29yZS9vcGVyYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7SUFBQSxvREFBNEY7SUFDNUYsNkNBQTRDO0lBYTVDLE1BQWEsU0FBUztRQUF0QjtZQUNTLFVBQUssR0F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RoaXMub3BlcmF0aW9uLnByb3RvLm5hbWU7XG4gIH1cblxuICBwdWJsaWMgcmVmKG5hbWU6IHN0cmluZykge1xuICAgIHRoaXMub3BlcmF0aW9uLmRlcGVuZGVuY2llcyhuYW1lKTtcbiAgICByZXR1cm4gdGhpcy5yZXNvbHZlKG5hbWUpO1xuICB9XG5cbiAgcHVibGljIHJlc29sdmUobmFtZTogc3RyaW5nKSB7XG4gICAgcmV0dXJuIHRoaXMub3BlcmF0aW9uLnNlc3Npb24ucmVzb2x2ZShuYW1lKTtcbiAgfVxuXG4gIHB1YmxpYyBkZXBlbmRlbmNpZXMobmFtZTogc3RyaW5nIHwgc3RyaW5nW10pIHtcbiAgICB0aGlzLm9wZXJhdGlvbi5kZXBlbmRlbmNpZXMobmFtZSk7XG4gICAgcmV0dXJuIFwiXCI7XG4gIH1cblxuICBwdWJsaWMgdGFncyhuYW1lOiBzdHJpbmcgfCBzdHJpbmdbXSkge1xuICAgIHRoaXMub3BlcmF0aW9uLnRhZ3MobmFtZSk7XG4gICAgcmV0dXJuIFwiXCI7XG4gIH1cblxuICBwdWJsaWMgaGFzT3V0cHV0KGhhc091dHB1dDogYm9vbGVhbikge1xuICAgIHRoaXMub3BlcmF0aW9uLmhhc091dHB1dChoYXNPdXRwdXQpO1xuICAgIHJldHVybiBcIlwiO1xuICB9XG5cbiAgcHVibGljIGFwcGx5PFQ+KHZhbHVlOiBPQ29udGV4dGFibGU8VD4pOiBUIHtcbiAgICBpZiAodHlwZW9mIHZhbHVlID09PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgIHJldHVybiAodmFsdWUgYXMgYW55KSh0aGlzKTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cbiAgfVxufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3BlcmF0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vL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ByZXR1cm4gXCJcIjtcbiAgfVxuXG4gIHB1YmxpYyBoYXNPdXRwdXQoaGFzT3V0cHV0OiBib29sZWFuKSB7XG4gICAgdGhpcy5vcGVyYXRpb24uaGFzT3V0cHV0KGhhc091dHB1dCk7XG4gICAgcmV0dXJuIFwiXCI7XG4gIH1cblxuICBwdWJsaWMgYXBwbHk8VD4odmFsdWU6IE9Db250ZXh0YWJsZTxUPik6IFQge1xuICAgIGlmICh0eXBlb2YgdmFsdWUgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgcmV0dXJuICh2YWx1ZSBhcyBhbnkpKHRoaXMpO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuICB9XG59XG4iXX0= |
{ | ||
"version": "1.2.5", | ||
"version": "1.3.0", | ||
"homepage": "https://github.com/dataform-co/dataform", | ||
@@ -24,3 +24,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@dataform/protos": "1.2.5", | ||
"@dataform/protos": "1.3.0", | ||
"moo": "^0.5.0", | ||
@@ -27,0 +27,0 @@ "protobufjs": "^6.8.8" |
/// <amd-module name="@dataform/core/session" /> | ||
import * as adapters from "@dataform/core/adapters"; | ||
import { AConfig, AContextable, Assertion } from "@dataform/core/assertion"; | ||
import { DConfig, Declaration } from "@dataform/core/declaration"; | ||
import { OConfig, OContextable, Operation } from "@dataform/core/operation"; | ||
@@ -12,5 +13,6 @@ import * as table from "@dataform/core/table"; | ||
dependencies?: string[]; | ||
target?: dataform.ITarget; | ||
} | ||
interface ISqlxConfig extends table.TConfig, AConfig, OConfig, test.TConfig { | ||
type: "view" | "table" | "inline" | "incremental" | "assertion" | "operations" | "test"; | ||
interface ISqlxConfig extends table.TConfig, AConfig, OConfig, DConfig, test.TConfig { | ||
type: "view" | "table" | "inline" | "incremental" | "assertion" | "operations" | "declaration" | "test"; | ||
name: string; | ||
@@ -26,14 +28,11 @@ } | ||
export declare function mapToColumnProtoArray(columns: IColumnsDescriptor): dataform.IColumnDescriptor[]; | ||
export interface FullyQualifiedName { | ||
schema: string; | ||
name: string; | ||
} | ||
export declare type Resolvable = string | FullyQualifiedName; | ||
export declare class Session { | ||
rootDir: string; | ||
config: dataform.IProjectConfig; | ||
tables: { | ||
[name: string]: table.Table; | ||
}; | ||
operations: { | ||
[name: string]: Operation; | ||
}; | ||
assertions: { | ||
[name: string]: Assertion; | ||
}; | ||
actions: Array<table.Table | Operation | Assertion | Declaration>; | ||
tests: { | ||
@@ -53,21 +52,22 @@ [name: string]: test.Test; | ||
hasInputs: boolean; | ||
}): Operation | table.Table | test.Test | Assertion; | ||
}): Declaration | table.Table | Operation | Assertion | test.Test; | ||
target(target: string, defaultSchema?: string): dataform.ITarget; | ||
resolve(name: string): string; | ||
resolve(ref: Resolvable): string; | ||
operate(name: string, queries?: OContextable<string | string[]>): Operation; | ||
publish(name: string, queryOrConfig?: table.TContextable<string> | table.TConfig): table.Table; | ||
assert(name: string, query?: AContextable<string>): Assertion; | ||
declare(dataset: FullyQualifiedName): Declaration; | ||
test(name: string): test.Test; | ||
compileError(err: Error | string, path?: string): void; | ||
compileGraphChunk<T>(part: { | ||
[name: string]: { | ||
proto: IActionProto; | ||
compile(): T; | ||
}; | ||
}): T[]; | ||
compileGraphChunk<T>(actions: Array<{ | ||
proto: IActionProto; | ||
compile(): T; | ||
}>): T[]; | ||
compile(): dataform.ICompiledGraph; | ||
isDatasetType(type: string): boolean; | ||
private checkActionNameIsUnused; | ||
findActions(res: Resolvable): (Declaration | table.Table | Operation | Assertion)[]; | ||
checkTargetIsUnused(target: dataform.ITarget): void; | ||
getSuffixWithUnderscore(): string; | ||
setNameAndTarget(action: IActionProto, name: string, overrideSchema?: string): void; | ||
private checkTestNameIsUnused; | ||
} | ||
export {}; |
202
session.js
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define("@dataform/core/session", ["require", "exports", "@dataform/core/adapters/index", "@dataform/core/assertion", "@dataform/core/operation", "@dataform/core/table", "@dataform/core/test", "@dataform/core/utils", "@dataform/protos"], factory); | ||
define("@dataform/core/session", ["require", "exports", "@dataform/core/adapters/index", "@dataform/core/assertion", "@dataform/core/declaration", "@dataform/core/operation", "@dataform/core/table", "@dataform/core/test", "@dataform/core/utils", "@dataform/protos"], factory); | ||
} | ||
@@ -15,2 +15,3 @@ })(function (require, exports) { | ||
const assertion_1 = require("@dataform/core/assertion"); | ||
const declaration_1 = require("@dataform/core/declaration"); | ||
const operation_1 = require("@dataform/core/operation"); | ||
@@ -55,5 +56,3 @@ const table = require("@dataform/core/table"); | ||
}; | ||
this.tables = {}; | ||
this.operations = {}; | ||
this.assertions = {}; | ||
this.actions = []; | ||
this.tests = {}; | ||
@@ -70,9 +69,9 @@ this.graphErrors = { compilationErrors: [] }; | ||
if (actionOptions.sqlxConfig.hasOutput && | ||
(actionOptions.sqlxConfig.type !== "operations" || | ||
this.isDatasetType(actionOptions.sqlxConfig.type))) { | ||
!(actionOptions.sqlxConfig.type === "operations" || | ||
definesDataset(actionOptions.sqlxConfig.type))) { | ||
this.compileError("Actions may only specify 'hasOutput: true' if they are of type 'operations' or create a dataset."); | ||
} | ||
if (actionOptions.sqlxConfig.columns && | ||
!(this.isDatasetType(actionOptions.sqlxConfig.type) || actionOptions.sqlxConfig.hasOutput)) { | ||
this.compileError("Actions may only specify 'columns' if they create a dataset."); | ||
!declaresDataset(actionOptions.sqlxConfig.type, actionOptions.sqlxConfig.hasOutput)) { | ||
this.compileError("Actions may only specify 'columns' if they create or declare a dataset."); | ||
} | ||
@@ -85,2 +84,5 @@ if (actionOptions.sqlxConfig.protected && actionOptions.sqlxConfig.type !== "incremental") { | ||
} | ||
if (!actionOptions.sqlxConfig.schema && actionOptions.sqlxConfig.type === "declaration") { | ||
this.compileError("Actions of type 'declaration' must specify a value for 'schema'."); | ||
} | ||
if (actionOptions.sqlxConfig.dataset && actionOptions.sqlxConfig.type !== "test") { | ||
@@ -95,19 +97,19 @@ this.compileError("Actions may only specify 'dataset' if they are of type 'test'."); | ||
} | ||
if (actionOptions.sqlxConfig.disabled && !this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
if (actionOptions.sqlxConfig.disabled && !definesDataset(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only specify 'disabled: true' if they create a dataset."); | ||
} | ||
if (actionOptions.sqlxConfig.redshift && !this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
if (actionOptions.sqlxConfig.redshift && !definesDataset(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only specify 'redshift: { ... }' if they create a dataset."); | ||
} | ||
if (actionOptions.sqlxConfig.sqldatawarehouse && | ||
!this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
!definesDataset(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only specify 'sqldatawarehouse: { ... }' if they create a dataset."); | ||
} | ||
if (actionOptions.sqlxConfig.bigquery && !this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
if (actionOptions.sqlxConfig.bigquery && !definesDataset(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only specify 'bigquery: { ... }' if they create a dataset."); | ||
} | ||
if (actionOptions.hasPreOperations && !this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
if (actionOptions.hasPreOperations && !definesDataset(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only include pre_operations if they create a dataset."); | ||
} | ||
if (actionOptions.hasPostOperations && !this.isDatasetType(actionOptions.sqlxConfig.type)) { | ||
if (actionOptions.hasPostOperations && !definesDataset(actionOptions.sqlxConfig.type)) { | ||
this.compileError("Actions may only include post_operations if they create a dataset."); | ||
@@ -126,2 +128,7 @@ } | ||
return this.operate(actionOptions.sqlxConfig.name); | ||
case "declaration": | ||
return this.declare({ | ||
schema: actionOptions.sqlxConfig.schema, | ||
name: actionOptions.sqlxConfig.name | ||
}); | ||
case "test": | ||
@@ -133,44 +140,35 @@ return this.test(actionOptions.sqlxConfig.name); | ||
})().config(actionOptions.sqlxConfig); | ||
if (action instanceof test.Test) { | ||
return action; | ||
} | ||
if (!(action instanceof operation_1.Operation) || action.proto.hasOutput) { | ||
const finalSchema = actionOptions.sqlxConfig.schema || | ||
(actionOptions.sqlxConfig.type === "assertion" | ||
? this.config.assertionSchema | ||
: this.config.defaultSchema); | ||
action.proto.target = this.target(actionOptions.sqlxConfig.name, finalSchema); | ||
} | ||
else { | ||
delete action.proto.target; | ||
} | ||
return action; | ||
} | ||
target(target, defaultSchema) { | ||
const suffix = !!this.config.schemaSuffix ? `_${this.config.schemaSuffix}` : ""; | ||
if (target.includes(".")) { | ||
const [schema, name] = target.split("."); | ||
return protos_1.dataform.Target.create({ name, schema: schema + suffix }); | ||
return protos_1.dataform.Target.create({ name, schema: schema + this.getSuffixWithUnderscore() }); | ||
} | ||
return protos_1.dataform.Target.create({ | ||
name: target, | ||
schema: (defaultSchema || this.config.defaultSchema) + suffix | ||
schema: (defaultSchema || this.config.defaultSchema) + this.getSuffixWithUnderscore() | ||
}); | ||
} | ||
resolve(name) { | ||
const table = this.tables[name]; | ||
const operation = !!this.operations[name] && this.operations[name].hasOutput && this.operations[name]; | ||
if (table && table.proto.type === "inline") { | ||
return `(${table.proto.query})`; | ||
resolve(ref) { | ||
const allResolved = this.findActions(ref); | ||
if (allResolved.length > 1) { | ||
this.compileError(new Error(utils.ambiguousActionNameMsg(ref, allResolved))); | ||
} | ||
const dataset = table || operation; | ||
const target = dataset ? dataset.proto.target : this.target(name); | ||
const resolved = allResolved.length > 0 ? allResolved[0] : undefined; | ||
if (resolved && resolved instanceof table.Table && resolved.proto.type === "inline") { | ||
return `(${resolved.proto.query})`; | ||
} | ||
if (resolved && resolved instanceof operation_1.Operation && !resolved.proto.hasOutput) { | ||
this.compileError(new Error("Actions cannot resolve operations which do not produce output.")); | ||
} | ||
const target = resolved | ||
? resolved.proto.target | ||
: this.target(typeof ref === "string" ? ref : ref.name); | ||
return this.adapter().resolveTarget(target); | ||
} | ||
operate(name, queries) { | ||
this.checkActionNameIsUnused(name); | ||
const operation = new operation_1.Operation(); | ||
operation.session = this; | ||
operation.proto.name = name; | ||
operation.proto.target = this.target(name); | ||
this.setNameAndTarget(operation.proto, name); | ||
if (queries) { | ||
@@ -180,11 +178,9 @@ operation.queries(queries); | ||
operation.proto.fileName = utils.getCallerFile(this.rootDir); | ||
this.operations[name] = operation; | ||
this.actions.push(operation); | ||
return operation; | ||
} | ||
publish(name, queryOrConfig) { | ||
this.checkActionNameIsUnused(name); | ||
const newTable = new table.Table(); | ||
newTable.session = this; | ||
newTable.proto.name = name; | ||
newTable.proto.target = this.target(name); | ||
this.setNameAndTarget(newTable.proto, name); | ||
if (!!queryOrConfig) { | ||
@@ -199,11 +195,9 @@ if (typeof queryOrConfig === "object") { | ||
newTable.proto.fileName = utils.getCallerFile(this.rootDir); | ||
this.tables[name] = newTable; | ||
this.actions.push(newTable); | ||
return newTable; | ||
} | ||
assert(name, query) { | ||
this.checkActionNameIsUnused(name); | ||
const assertion = new assertion_1.Assertion(); | ||
assertion.session = this; | ||
assertion.proto.name = name; | ||
assertion.proto.target = this.target(name, this.config.assertionSchema); | ||
this.setNameAndTarget(assertion.proto, name, this.config.assertionSchema); | ||
if (query) { | ||
@@ -213,5 +207,15 @@ assertion.query(query); | ||
assertion.proto.fileName = utils.getCallerFile(this.rootDir); | ||
this.assertions[name] = assertion; | ||
this.actions.push(assertion); | ||
return assertion; | ||
} | ||
declare(dataset) { | ||
const declaration = new declaration_1.Declaration(); | ||
declaration.session = this; | ||
this.checkTargetIsUnused(dataset); | ||
declaration.proto.target = dataset; | ||
declaration.proto.name = `${dataset.schema}.${dataset.name}`; | ||
declaration.proto.fileName = utils.getCallerFile(this.rootDir); | ||
this.actions.push(declaration); | ||
return declaration; | ||
} | ||
test(name) { | ||
@@ -240,11 +244,11 @@ this.checkTestNameIsUnused(name); | ||
} | ||
compileGraphChunk(part) { | ||
compileGraphChunk(actions) { | ||
const compiledChunks = []; | ||
Object.keys(part).forEach(key => { | ||
actions.forEach(action => { | ||
try { | ||
const compiledChunk = part[key].compile(); | ||
const compiledChunk = action.compile(); | ||
compiledChunks.push(compiledChunk); | ||
} | ||
catch (e) { | ||
this.compileError(e, part[key].proto.fileName); | ||
this.compileError(e, action.proto.fileName); | ||
} | ||
@@ -257,32 +261,72 @@ }); | ||
projectConfig: this.config, | ||
tables: this.compileGraphChunk(this.tables), | ||
operations: this.compileGraphChunk(this.operations), | ||
assertions: this.compileGraphChunk(this.assertions), | ||
tests: this.compileGraphChunk(this.tests), | ||
tables: this.compileGraphChunk(this.actions.filter(action => action instanceof table.Table)), | ||
operations: this.compileGraphChunk(this.actions.filter(action => action instanceof operation_1.Operation)), | ||
assertions: this.compileGraphChunk(this.actions.filter(action => action instanceof assertion_1.Assertion)), | ||
declarations: this.compileGraphChunk(this.actions.filter(action => action instanceof declaration_1.Declaration)), | ||
tests: this.compileGraphChunk(Object.values(this.tests)), | ||
graphErrors: this.graphErrors | ||
}); | ||
const allActions = [].concat(compiledGraph.tables, compiledGraph.assertions, compiledGraph.operations); | ||
const allActionNames = allActions.map(action => action.name); | ||
allActions.forEach(action => { | ||
const uniqueDependencies = {}; | ||
const dependencies = action.dependencies || []; | ||
dependencies | ||
.filter(dependency => !dependency.includes("*")) | ||
.forEach(dependency => (uniqueDependencies[dependency] = true)); | ||
utils | ||
.matchPatterns(dependencies.filter(d => d.includes("*")), allActionNames) | ||
.forEach(dependency => (uniqueDependencies[dependency] = true)); | ||
action.dependencies = Object.keys(uniqueDependencies); | ||
const allActionsByName = {}; | ||
[] | ||
.concat(compiledGraph.tables, compiledGraph.assertions, compiledGraph.operations, compiledGraph.declarations) | ||
.forEach(action => (allActionsByName[action.name] = action)); | ||
Object.values(allActionsByName).forEach(action => { | ||
const fQDeps = (action.dependencies || []).map(act => { | ||
const allActs = this.findActions(act); | ||
if (allActs.length === 1) { | ||
return `${allActs[0].proto.target.schema}.${allActs[0].proto.target.name}`; | ||
} | ||
else if (allActs.length >= 1) { | ||
this.compileError(new Error(utils.ambiguousActionNameMsg(act, allActs))); | ||
return act; | ||
} | ||
else { | ||
this.compileError(new Error(`Missing dependency detected: Node "${action.name}" depends on "${act}" which does not exist.`)); | ||
return act; | ||
} | ||
}); | ||
action.dependencies = [...new Set(fQDeps || [])]; | ||
}); | ||
const checkCircular = (action, dependents) => { | ||
if (dependents.indexOf(action) >= 0) { | ||
const message = `Circular dependency detected in chain: [${dependents | ||
.map(d => d.name) | ||
.join(" > ")} > ${action.name}]`; | ||
this.compileError(new Error(message)); | ||
return true; | ||
} | ||
return (action.dependencies || []).some(d => { | ||
return (allActionsByName[d] && checkCircular(allActionsByName[d], dependents.concat([action]))); | ||
}); | ||
}; | ||
for (const action of Object.values(allActionsByName)) { | ||
if (checkCircular(action, [])) { | ||
break; | ||
} | ||
} | ||
return compiledGraph; | ||
} | ||
isDatasetType(type) { | ||
return type === "view" || type === "table" || type === "inline" || type === "incremental"; | ||
findActions(res) { | ||
return this.actions.filter(action => { | ||
if (typeof res === "string") { | ||
return action.proto.target.name === res; | ||
} | ||
return action.proto.target.schema === res.schema && action.proto.target.name === res.name; | ||
}); | ||
} | ||
checkActionNameIsUnused(name) { | ||
if (this.tables[name] || this.operations[name] || this.assertions[name]) { | ||
const message = `Duplicate action name detected. Names must be unique across tables, assertions, and operations: "${name}"`; | ||
this.compileError(new Error(message)); | ||
checkTargetIsUnused(target) { | ||
const duplicateActions = this.findActions({ schema: target.schema, name: target.name }); | ||
if (duplicateActions && duplicateActions.length > 0) { | ||
this.compileError(new Error(`Duplicate action name detected. Names within a schema must be unique across tables, assertions, and operations: "${target.schema}.${target.name}"`)); | ||
} | ||
} | ||
getSuffixWithUnderscore() { | ||
return !!this.config.schemaSuffix ? `_${this.config.schemaSuffix}` : ""; | ||
} | ||
setNameAndTarget(action, name, overrideSchema) { | ||
const newTarget = overrideSchema ? this.target(name, overrideSchema) : this.target(name); | ||
this.checkTargetIsUnused(newTarget); | ||
action.target = newTarget; | ||
action.name = `${action.target.schema}.${action.target.name}`; | ||
} | ||
checkTestNameIsUnused(name) { | ||
@@ -296,3 +340,9 @@ if (this.tests[name]) { | ||
exports.Session = Session; | ||
function declaresDataset(type, hasOutput) { | ||
return definesDataset(type) || type === "declaration" || hasOutput; | ||
} | ||
function definesDataset(type) { | ||
return type === "view" || type === "table" || type === "inline" || type === "incremental"; | ||
} | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2Vzc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2NvcmUvc2Vzc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztJQUFBLDBEQUFvRDtJQUNwRCx3REFBNEU7SUFDNUUsd0RBQTRFO0lBQzVFLDhDQUE4QztJQUM5Qyw0Q0FBNEM7SUFDNUMsOENBQThDO0lBQzlDLDZDQUE0QztJQXNCNUMsU0FBZ0IscUJBQXFCLENBQUMsT0FBMkI7UUFDL0QsT0FBTyxLQUFLLENBQUMsT0FBTyxDQUNsQixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsRUFBRSxDQUFDLDJCQUEyQixDQUFDLENBQUMsTUFBTSxDQUFDLEVBQUUsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FDM0YsQ0FBQztJQUNKLENBQUM7SUFKRCxzREFJQztJQUVELFNBQVMsMkJBQTJCLENBQ2xDLFdBQXFCLEVBQ3JCLFdBQXVDO1FBRXZDLElBQUksT0FBTyxXQUFXLEtBQUssUUFBUSxFQUFFO1lBQ25DLE9BQU87Z0JBQ0wsaUJBQVEsQ0FBQyxnQkFBZ0IsQ0FBQyxNQUFNLENBQUM7b0JBQy9CLFdBQVc7b0JBQ1gsSUFBSSxFQUFFLFdBQVc7aUJBQ2xCLENBQUM7YUFDSCxDQUF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sDescriptor, Session } from "@dataform/core/session"; | ||
import { IColumnsDescriptor, Resolvable, Session } from "@dataform/core/session"; | ||
import { dataform } from "@dataform/protos"; | ||
@@ -27,3 +27,3 @@ export declare enum TableTypes { | ||
type?: TableType; | ||
dependencies?: string | string[]; | ||
dependencies?: Resolvable | Resolvable[]; | ||
tags?: string[]; | ||
@@ -56,7 +56,7 @@ description?: string; | ||
bigquery(bigquery: dataform.IBigQueryOptions): this; | ||
dependencies(value: string | string[]): this; | ||
dependencies(value: Resolvable | Resolvable[]): this; | ||
tags(value: string | string[]): this; | ||
description(description: string): this; | ||
columns(columns: IColumnsDescriptor): this; | ||
schema(schema: string): void; | ||
schema(schema: string): this; | ||
compile(): dataform.Table; | ||
@@ -78,3 +78,3 @@ private addDependency; | ||
bigquery: (bigquery: dataform.IBigQueryOptions) => string; | ||
dependencies: (name: string) => string; | ||
dependencies: (name: Resolvable) => string; | ||
apply: <T>(value: TContextable<T>) => T; | ||
@@ -89,4 +89,4 @@ tags: (name: string | string[]) => string; | ||
name(): string; | ||
ref(name: string): string; | ||
resolve(name: string): string; | ||
ref(ref: Resolvable): string; | ||
resolve(ref: Resolvable): string; | ||
type(type: TableType): string; | ||
@@ -99,3 +99,3 @@ where(where: TContextable<string>): string; | ||
bigquery(bigquery: dataform.IBigQueryOptions): string; | ||
dependencies(name: string): string; | ||
dependencies(res: Resolvable): string; | ||
apply<T>(value: TContextable<T>): T; | ||
@@ -102,0 +102,0 @@ tags(tags: string[]): string; |
50
table.js
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define("@dataform/core/table", ["require", "exports", "@dataform/core/session", "@dataform/protos"], factory); | ||
define("@dataform/core/table", ["require", "exports", "@dataform/core/session", "@dataform/core/utils", "@dataform/protos"], factory); | ||
} | ||
@@ -14,2 +14,3 @@ })(function (require, exports) { | ||
const session_1 = require("@dataform/core/session"); | ||
const utils = require("@dataform/core/utils"); | ||
const protos_1 = require("@dataform/protos"); | ||
@@ -126,10 +127,12 @@ var TableTypes; | ||
dependencies(value) { | ||
const newDependencies = typeof value === "string" ? [value] : value; | ||
newDependencies.forEach(d => { | ||
const table = this.session.tables[d]; | ||
if (!!table && table.proto.type === "inline") { | ||
table.proto.dependencies.forEach(childDep => this.addDependency(childDep)); | ||
const newDependencies = utils.isResolvable(value) ? [value] : value; | ||
newDependencies.forEach((d) => { | ||
const depFinal = utils.appendSuffixToSchema(d, this.session.getSuffixWithUnderscore()); | ||
const allResolved = this.session.findActions(depFinal); | ||
const resolved = allResolved.length > 0 ? allResolved[0] : undefined; | ||
if (!!resolved && resolved instanceof Table && resolved.proto.type === "inline") { | ||
resolved.proto.dependencies.forEach(childDep => this.addDependency(childDep)); | ||
} | ||
else { | ||
this.addDependency(d); | ||
this.addDependency(depFinal); | ||
} | ||
@@ -142,3 +145,2 @@ }); | ||
newTags.forEach(t => { | ||
const table = this.session.tables[t]; | ||
this.proto.tags.push(t); | ||
@@ -163,3 +165,6 @@ }); | ||
schema(schema) { | ||
this.proto.target = this.session.target(schema); | ||
if (schema !== this.session.config.defaultSchema) { | ||
this.session.setNameAndTarget(this.proto, this.proto.target.name, schema); | ||
} | ||
return this; | ||
} | ||
@@ -185,4 +190,5 @@ compile() { | ||
addDependency(dependency) { | ||
if (this.proto.dependencies.indexOf(dependency) < 0) { | ||
this.proto.dependencies.push(dependency); | ||
const depName = utils.stringifyResolvable(dependency); | ||
if (this.proto.dependencies.indexOf(depName) < 0) { | ||
this.proto.dependencies.push(depName); | ||
} | ||
@@ -201,8 +207,12 @@ } | ||
self() { | ||
return this.resolve(this.table.proto.name); | ||
return this.resolve({ | ||
schema: this.table.proto.target.schema, | ||
name: this.table.proto.target.name | ||
}); | ||
} | ||
name() { | ||
return this.table.proto.name; | ||
return this.table.proto.target.name; | ||
} | ||
ref(name) { | ||
ref(ref) { | ||
const name = typeof ref === "string" || typeof ref === "undefined" ? ref : `${ref.schema}.${ref.name}`; | ||
if (!name) { | ||
@@ -214,6 +224,6 @@ const message = `Action name is not specified`; | ||
this.table.dependencies(name); | ||
return this.resolve(name); | ||
return this.resolve(ref); | ||
} | ||
resolve(name) { | ||
return this.table.session.resolve(name); | ||
resolve(ref) { | ||
return this.table.session.resolve(ref); | ||
} | ||
@@ -248,4 +258,4 @@ type(type) { | ||
} | ||
dependencies(name) { | ||
this.table.dependencies(name); | ||
dependencies(res) { | ||
this.table.dependencies(res); | ||
return ""; | ||
@@ -268,2 +278,2 @@ } | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9jb3JlL3RhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0lBQUEsb0RBQTRGO0lBQzVGLDZDQUE0QztJQUU1QyxJQUFZLFVBS1g7SUFMRCxXQUFZLFVBQVU7UUFDcEIsNkJBQWUsQ0FBQTtRQUNmLDJCQUFhLENBQUE7UUFDYix5Q0FBMkIsQ0FBQTtRQUMzQiwrQkFBaUIsQ0FBQTtJQUNuQixDQUFDLEVBTFcsVUFBVSxHQUFWLGtCQUFVLEtBQVYsa0JBQVUsUUFLckI7SUFDRCxJQUFZLGNBSVg7SUFKRCxXQUFZLGNBQWM7UUFDeEIsK0JBQWEsQ0FBQTtRQUNiLDZCQUFXLENBQUE7UUFDWCw2QkFBVyxDQUFBO0lBQ2IsQ0FBQyxFQUpXLGNBQWMsR0FBZCxzQkFBYyxLQUFkLHNCQUFjLFFBSXpCO0lBQ0QsSUFBWSxjQUdYO0lBSEQsV0FBWSxjQUFjO1FBQ3hCLHVDQUFxQixDQUFBO1FBQ3JCLDZDQUEyQixDQUFBO0lBQzdCLENBQUMsRUFIVyxjQUFjLEdBQWQsc0JBQWMsS0FBZCxzQkFBYyxRQUd6QjtJQUVZLFFBQUEsWUFBWSxHQUVyQjtRQUNGLENBQUMsV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CgpIHtcbiAgICB0aGlzLnRhYmxlLmRpc2FibGVkKCk7XG4gICAgcmV0dXJuIFwiXCI7XG4gIH1cblxuICBwdWJsaWMgcmVkc2hpZnQocmVkc2hpZnQ6IGRhdGFmb3JtLklSZWRzaGlmdE9wdGlvbnMpIHtcbiAgICB0aGlzLnRhYmxlLnJlZHNoaWZ0KHJlZHNoaWZ0KTtcbiAgICByZXR1cm4gXCJcIjtcbiAgfVxuXG4gIHB1YmxpYyBiaWdxdWVyeShiaWdxdWVyeTogZGF0YWZvcm0uSUJpZ1F1ZXJ5T3B0aW9ucykge1xuICAgIHRoaXMudGFibGUuYmlncXVlcnkoYmlncXVlcnkpO1xuICAgIHJldHVybiBcIlwiO1xuICB9XG5cbiAgcHVibGljIGRlcGVuZGVuY2llcyhyZXM6IFJlc29sdmFibGUpIHtcbiAgICB0aGlzLnRhYmxlLmRlcGVuZGVuY2llcyhyZXMpO1xuICAgIHJldHVybiBcIlwiO1xuICB9XG5cbiAgcHVibGljIGFwcGx5PFQ+KHZhbHVlOiBUQ29udGV4dGFibGU8VD4pOiBUIHtcbiAgICBpZiAodHlwZW9mIHZhbHVlID09PSBcImZ1bmN0aW9uXCIpIHtcbiAgICAgIHJldHVybiAodmFsdWUgYXMgYW55KSh0aGlzKTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cbiAgfVxuICBwdWJsaWMgdGFncyh0YWdzOiBzdHJpbmdbXSkge1xuICAgIHRoaXMudGFibGUudGFncyh0YWdzKTtcbiAgICByZXR1cm4gXCJcIjtcbiAgfVxufVxuIl19 |
/// <amd-module name="@dataform/core/test" /> | ||
import { Session } from "@dataform/core/session"; | ||
import { Resolvable, Session } from "@dataform/core/session"; | ||
import { dataform } from "@dataform/protos"; | ||
export declare type TContextable<T> = T | ((ctx: TestContext) => T); | ||
export interface TConfig { | ||
dataset?: string; | ||
dataset?: Resolvable; | ||
} | ||
@@ -17,3 +17,3 @@ export declare class Test { | ||
config(config: TConfig): this; | ||
dataset(datasetToTest: string): this; | ||
dataset(ref: Resolvable): this; | ||
input(refName: string, contextableQuery: TContextable<string>): this; | ||
@@ -20,0 +20,0 @@ expect(contextableQuery: TContextable<string>): this; |
23
test.js
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define("@dataform/core/test", ["require", "exports", "@dataform/protos"], factory); | ||
define("@dataform/core/test", ["require", "exports", "@dataform/core/table", "@dataform/core/utils", "@dataform/protos"], factory); | ||
} | ||
@@ -13,2 +13,4 @@ })(function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const table = require("@dataform/core/table"); | ||
const utils = require("@dataform/core/utils"); | ||
const protos_1 = require("@dataform/protos"); | ||
@@ -26,4 +28,4 @@ class Test { | ||
} | ||
dataset(datasetToTest) { | ||
this.datasetToTest = datasetToTest; | ||
dataset(ref) { | ||
this.datasetToTest = ref; | ||
return this; | ||
@@ -45,6 +47,13 @@ } | ||
else { | ||
const dataset = this.session.tables[this.datasetToTest]; | ||
if (!dataset) { | ||
this.session.compileError(new Error(`Dataset ${this.datasetToTest} could not be found.`), this.proto.fileName); | ||
const datasetToTestFinal = typeof this.datasetToTest === "string" | ||
? utils.targetAsResolvable(this.session.target(this.datasetToTest)) | ||
: utils.targetAsResolvable(this.session.target(`${this.datasetToTest.schema}.${this.datasetToTest.name}`)); | ||
const allResolved = this.session.findActions(datasetToTestFinal); | ||
if (allResolved.length > 1) { | ||
this.session.compileError(new Error(utils.ambiguousActionNameMsg(datasetToTestFinal, allResolved))); | ||
} | ||
const dataset = allResolved.length > 0 ? allResolved[0] : undefined; | ||
if (!(dataset && dataset instanceof table.Table)) { | ||
this.session.compileError(new Error(`Dataset ${utils.stringifyResolvable(this.datasetToTest)} could not be found.`), this.proto.fileName); | ||
} | ||
else if (dataset.proto.type === "incremental") { | ||
@@ -137,2 +146,2 @@ this.session.compileError(new Error("Running tests on incremental datasets is not yet supported."), this.proto.fileName); |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BwdWJsaWMgZGlzYWJsZWQoKSB7XG4gICAgcmV0dXJuIFwiXCI7XG4gIH1cblxuICBwdWJsaWMgcmVkc2hpZnQocmVkc2hpZnQ6IGRhdGFmb3JtLklSZWRzaGlmdE9wdGlvbnMpIHtcbiAgICByZXR1cm4gXCJcIjtcbiAgfVxuXG4gIHB1YmxpYyBiaWdxdWVyeShiaWdxdWVyeTogZGF0YWZvcm0uSUJpZ1F1ZXJ5T3B0aW9ucykge1xuICAgIHJldHVybiBcIlwiO1xuICB9XG5cbiAgcHVibGljIGRlcGVuZGVuY2llcyhuYW1lOiBzdHJpbmcpIHtcbiAgICByZXR1cm4gXCJcIjtcbiAgfVxuXG4gIHB1YmxpYyB0YWdzKHRhZ3M6IHN0cmluZ1tdKSB7XG4gICAgcmV0dXJuIFwiXCI7XG4gIH1cbn1cbiJdfQ== |
/// <amd-module name="@dataform/core/utils" /> | ||
import { Assertion } from "@dataform/core/assertion"; | ||
import { Declaration } from "@dataform/core/declaration"; | ||
import { Operation } from "@dataform/core/operation"; | ||
import { Resolvable } from "@dataform/core/session"; | ||
import { Table } from "@dataform/core/table"; | ||
import { dataform } from "@dataform/protos"; | ||
@@ -11,1 +16,9 @@ export declare function relativePath(path: string, base: string): string; | ||
export declare function flatten<T>(nestedArray: T[][]): T[]; | ||
export declare function isResolvable(res: any): boolean; | ||
export declare function stringifyResolvable(res: Resolvable): string; | ||
export declare function targetAsResolvable(t: dataform.ITarget): { | ||
schema: string; | ||
name: string; | ||
}; | ||
export declare function appendSuffixToSchema(d: Resolvable, suffix: string): string; | ||
export declare function ambiguousActionNameMsg(act: Resolvable, allActs: Array<Table | Operation | Assertion | Declaration> | string[]): string; |
93
utils.js
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define("@dataform/core/utils", ["require", "exports", "@dataform/protos", "@dataform/core/table"], factory); | ||
define("@dataform/core/utils", ["require", "exports", "@dataform/core/table", "@dataform/protos"], factory); | ||
} | ||
@@ -13,4 +13,4 @@ })(function (require, exports) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const table_1 = require("@dataform/core/table"); | ||
const protos_1 = require("@dataform/protos"); | ||
const table_1 = require("@dataform/core/table"); | ||
const SQL_DATA_WAREHOUSE_DIST_HASH_REGEXP = new RegExp("HASH\\s*\\(\\s*\\w*\\s*\\)\\s*"); | ||
@@ -43,9 +43,21 @@ function relativePath(path, base) { | ||
function matchPatterns(patterns, values) { | ||
const regexps = patterns.map(pattern => new RegExp("^" + | ||
pattern | ||
.replace(/[.+?^${}()|[\]\\]/g, "\\$&") | ||
.split("*") | ||
.join(".*") + | ||
"$")); | ||
return values.filter(value => regexps.filter(regexp => regexp.test(value)).length > 0); | ||
const fQActs = []; | ||
patterns.forEach(pat => { | ||
if (pat.includes(".")) { | ||
if (values.includes(pat)) { | ||
fQActs.push(pat); | ||
} | ||
} | ||
else { | ||
const matchingActions = values.filter(value => pat === value.split(".").slice(-1)[0]); | ||
if (matchingActions.length === 0) { | ||
return; | ||
} | ||
if (matchingActions.length > 1) { | ||
throw new Error(ambiguousActionNameMsg(pat, matchingActions)); | ||
} | ||
fQActs.push(matchingActions[0]); | ||
} | ||
}); | ||
return fQActs; | ||
} | ||
@@ -106,40 +118,5 @@ exports.matchPatterns = matchPatterns; | ||
const validationErrors = []; | ||
const allActions = [].concat(compiledGraph.tables, compiledGraph.assertions, compiledGraph.operations); | ||
const allActionNames = allActions.map(action => action.name); | ||
allActions.forEach(action => { | ||
if (allActions.filter(subAction => subAction.name == action.name).length > 1) { | ||
const actionName = action.name; | ||
const message = `Duplicate action name detected, names must be unique across tables, assertions, and operations: "${action.name}"`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
} | ||
}); | ||
const allActions = [].concat(compiledGraph.tables, compiledGraph.assertions, compiledGraph.operations, compiledGraph.declarations); | ||
const actionsByName = {}; | ||
allActions.forEach(action => (actionsByName[action.name] = action)); | ||
allActions.forEach(action => { | ||
const actionName = action.name; | ||
(action.dependencies || []).forEach((dependency) => { | ||
if (allActionNames.indexOf(dependency) < 0) { | ||
const message = `Missing dependency detected: Node "${action.name}" depends on "${dependency}" which does not exist.`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
} | ||
}); | ||
}); | ||
const checkCircular = (action, dependents) => { | ||
if (dependents.indexOf(action) >= 0) { | ||
const actionName = action.name; | ||
const message = `Circular dependency detected in chain: [${dependents | ||
.map(d => d.name) | ||
.join(" > ")} > ${action.name}]`; | ||
validationErrors.push(protos_1.dataform.ValidationError.create({ message, actionName })); | ||
return true; | ||
} | ||
return (action.dependencies || []).some(d => { | ||
return actionsByName[d] && checkCircular(actionsByName[d], dependents.concat([action])); | ||
}); | ||
}; | ||
for (const action of allActions) { | ||
if (checkCircular(action, [])) { | ||
break; | ||
} | ||
} | ||
compiledGraph.tables.forEach(action => { | ||
@@ -215,3 +192,27 @@ const actionName = action.name; | ||
exports.flatten = flatten; | ||
function isResolvable(res) { | ||
return typeof res === "string" || (!!res.schema && !!res.name); | ||
} | ||
exports.isResolvable = isResolvable; | ||
function stringifyResolvable(res) { | ||
return typeof res === "string" ? res : `${res.schema}.${res.name}`; | ||
} | ||
exports.stringifyResolvable = stringifyResolvable; | ||
function targetAsResolvable(t) { | ||
return { schema: t.schema, name: t.name }; | ||
} | ||
exports.targetAsResolvable = targetAsResolvable; | ||
function appendSuffixToSchema(d, suffix) { | ||
const dStr = stringifyResolvable(d); | ||
return dStr.includes(".") ? `${dStr.split(".")[0]}${suffix}.${dStr.split(".")[1]}` : dStr; | ||
} | ||
exports.appendSuffixToSchema = appendSuffixToSchema; | ||
function ambiguousActionNameMsg(act, allActs) { | ||
const allActNames = typeof allActs[0] === "string" | ||
? allActs | ||
: allActs.map(r => `${r.proto.target.schema}.${r.proto.target.name}`); | ||
return `Ambiguous Action name: ${stringifyResolvable(act)}. Did you mean one of: ${allActNames.join(", ")}.`; | ||
} | ||
exports.ambiguousActionNameMsg = ambi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gc2NoZW1hOiB0LnNjaGVtYSwgbmFtZTogdC5uYW1lIH07XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBhcHBlbmRTdWZmaXhUb1NjaGVtYShkOiBSZXNvbHZhYmxlLCBzdWZmaXg6IHN0cmluZykge1xuICBjb25zdCBkU3RyID0gc3RyaW5naWZ5UmVzb2x2YWJsZShkKTtcbiAgcmV0dXJuIGRTdHIuaW5jbHVkZXMoXCIuXCIpID8gYCR7ZFN0ci5zcGxpdChcIi5cIilbMF19JHtzdWZmaXh9LiR7ZFN0ci5zcGxpdChcIi5cIilbMV19YCA6IGRTdHI7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBhbWJpZ3VvdXNBY3Rpb25OYW1lTXNnKFxuICBhY3Q6IFJlc29sdmFibGUsXG4gIGFsbEFjdHM6IEFycmF5PFRhYmxlIHwgT3BlcmF0aW9uIHwgQXNzZXJ0aW9uIHwgRGVjbGFyYXRpb24+IHwgc3RyaW5nW11cbikge1xuICBjb25zdCBhbGxBY3ROYW1lcyA9XG4gICAgdHlwZW9mIGFsbEFjdHNbMF0gPT09IFwic3RyaW5nXCJcbiAgICAgID8gYWxsQWN0c1xuICAgICAgOiAoYWxsQWN0cyBhcyBBcnJheTxUYWJsZSB8IE9wZXJhdGlvbiB8IEFzc2VydGlvbj4pLm1hcChcbiAgICAgICAgICByID0+IGAke3IucHJvdG8udGFyZ2V0LnNjaGVtYX0uJHtyLnByb3RvLnRhcmdldC5uYW1lfWBcbiAgICAgICAgKTtcbiAgcmV0dXJuIGBBbWJpZ3VvdXMgQWN0aW9uIG5hbWU6ICR7c3RyaW5naWZ5UmVzb2x2YWJsZShcbiAgICBhY3RcbiAgKX0uIERpZCB5b3UgbWVhbiBvbmUgb2Y6ICR7YWxsQWN0TmFtZXMuam9pbihcIiwgXCIpfS5gO1xufVxuIl19 |
338471
37
2769
+ Added@dataform/protos@1.3.0(transitive)
- Removed@dataform/protos@1.2.5(transitive)
Updated@dataform/protos@1.3.0