Skip to content

Commit

Permalink
Fix assertion schema names in SQLX. (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenBirt authored Jul 25, 2019
1 parent 132a78b commit 3d620b6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
10 changes: 6 additions & 4 deletions core/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,12 @@ export class Session {
}
})();
if (action.proto.target) {
action.proto.target = this.target(
actionOptions.sqlxConfig.name,
actionOptions.sqlxConfig.schema
);
const finalSchema =
actionOptions.sqlxConfig.schema ||
(actionOptions.sqlxConfig.type === "assertion"
? this.config.assertionSchema
: this.config.defaultSchema);
action.proto.target = this.target(actionOptions.sqlxConfig.name, finalSchema);
}
return action;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
config {
schema: "hi_there",
type: "assertion",
tags: ["tag1", "tag2"]
}
Expand Down
3 changes: 3 additions & 0 deletions tests/api/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,9 @@ describe("@dataform/api", () => {
t => t.name === "example_assertion_with_tags"
);
expect(exampleAssertionWithTags).to.not.be.undefined;
expect(exampleAssertionWithTags.target.schema).equals(
schemaWithSuffix("df_integration_test_assertions")
);
expect(exampleAssertionWithTags.tags).to.eql(["tag1", "tag2"]);

// Check example operations file
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.0.7"
DF_VERSION = "1.0.8"

0 comments on commit 3d620b6

Please sign in to comment.