Skip to content

Commit

Permalink
Make the 'protected' setting work. (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenBirt authored Sep 11, 2019
1 parent 0693a19 commit 58319eb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions core/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export class Table {
if (config.disabled) {
this.disabled();
}
if (config.protected) {
this.protected();
}
if (config.redshift) {
this.redshift(config.redshift);
}
Expand Down Expand Up @@ -137,6 +140,11 @@ export class Table {
return this;
}

public protected() {
this.proto.protected = true;
return this;
}

public sqldatawarehouse(sqlDataWarehouse: dataform.ISQLDataWarehouseOptions) {
this.proto.sqlDataWarehouse = dataform.SQLDataWarehouseOptions.create(sqlDataWarehouse);
return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
config { type: "incremental" }
config { type: "incremental", protected: true }

js { const crossdb = require("@dataform/crossdb"); }

Expand Down
1 change: 1 addition & 0 deletions tests/api/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ describe("@dataform/api", () => {
t.name === schemaWithSuffix("df_integration_test") + ".example_incremental"
);
expect(exampleIncremental).to.not.be.undefined;
expect(exampleIncremental.protected).eql(true);
expect(exampleIncremental.query.trim()).equals("select current_timestamp() as ts");
expect(exampleIncremental.where.trim()).equals(
`ts > (select max(ts) from \`tada-analytics.${schemaWithSuffix(
Expand Down
2 changes: 1 addition & 1 deletion version.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# NOTE: If you change the format of this line, you must change the bash command
# in /scripts/publish to extract the version string correctly.
DF_VERSION = "1.3.3"
DF_VERSION = "1.3.4"

0 comments on commit 58319eb

Please sign in to comment.