Skip to content

Commit

Permalink
Upgrade glob. (#1525)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenBirt authored Aug 15, 2023
1 parent 2ba748c commit a5ee673
Show file tree
Hide file tree
Showing 5 changed files with 262 additions and 116 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@types/es6-shim": "^0.31.37",
"@types/express": "^4.17.1",
"@types/fs-extra": "^8.1.0",
"@types/glob": "^7.1.1",
"@types/glob": "^8.1.0",
"@types/google-protobuf": "^3.2.7",
"@types/js-beautify": "^1.8.1",
"@types/json-stable-stringify": "^1.0.32",
Expand Down Expand Up @@ -73,7 +73,7 @@
"front-matter": "^4.0.1",
"fs-extra": "^9.0.0",
"get-port": "^5.1.1",
"glob": "^7.1.3",
"glob": "^10.3.3",
"google-protobuf": "^3.6.1",
"grpc": "^1.24.0",
"grpc-web-client": "^0.5.0",
Expand Down
1 change: 1 addition & 0 deletions tests/api/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ts_test_suite(
"//api",
"//api/utils",
"//common/promises",
"//common/strings",
"//core",
"//protos:ts",
"//testing",
Expand Down
175 changes: 78 additions & 97 deletions tests/api/examples.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { expect } from "chai";
import * as path from "path";

import { Builder, compile } from "df/api";
import { JSONObjectStringifier, StringifiedSet } from "df/common/strings/stringifier";
import { targetAsReadableString } from "df/core/targets";
import { dataform } from "df/protos/ts";
import { suite, test } from "df/testing";
Expand All @@ -25,77 +26,83 @@ suite("examples", () => {
useMain
});
expect(
graph.graphErrors.compilationErrors.map(({ fileName, message }) => ({
fileName,
message
}))
).deep.equals([
{
fileName: "includes/example_ignore.js",
message: "publish is not defined"
},
{
fileName: "definitions/has_compile_errors/assertion_with_bigquery.sqlx",
message:
'Unexpected property "bigquery" in assertion config. Supported properties are: ["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]'
},
{
fileName: "definitions/has_compile_errors/assertion_with_materialized.sqlx",
message:
'Unexpected property "materialized" in assertion config. Supported properties are: ["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]'
},
{
fileName: "definitions/has_compile_errors/assertion_with_output.sqlx",
message:
'Unexpected property "hasOutput" in assertion config. Supported properties are: ["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]'
},
{
fileName: "definitions/has_compile_errors/assertion_with_postops.sqlx",
message: "Actions may only include post_operations if they create a dataset."
},
{
fileName: "definitions/has_compile_errors/assertion_with_preops.sqlx",
message: "Actions may only include pre_operations if they create a dataset."
},
{
fileName: "definitions/has_compile_errors/assertion_with_redshift.sqlx",
message:
'Unexpected property "redshift" in assertion config. Supported properties are: ["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]'
},
{
fileName: "definitions/has_compile_errors/protected_assertion.sqlx",
message:
"Actions may only specify 'protected: true' if they are of type 'incremental'."
},
{
fileName: "definitions/has_compile_errors/protected_assertion.sqlx",
message:
'Unexpected property "protected" in assertion config. Supported properties are: ["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]'
},
{
fileName: "definitions/has_compile_errors/view_with_incremental.sqlx",
message:
"Actions may only include incremental_where if they are of type 'incremental'."
},
{
fileName: "definitions/has_compile_errors/view_with_multiple_statements.sqlx",
message:
"Actions may only contain more than one SQL statement if they are of type 'operations'."
},
{
fileName: "definitions/has_compile_errors/view_with_semi_colon_at_end.sqlx",
message: "Semi-colons are not allowed at the end of SQL statements."
},
{
fileName: "definitions/has_compile_errors/table_with_materialized.sqlx",
message: "The 'materialized' option is only valid for Snowflake and BigQuery views"
},
{
fileName: "definitions/has_compile_errors/view_without_hermetic.sqlx",
message:
"Zero-dependency actions which create datasets are required to explicitly declare 'hermetic: (true|false)' when run caching is turned on."
}
]);
new StringifiedSet(
new JSONObjectStringifier(),
graph.graphErrors.compilationErrors.map(({ fileName, message }) => ({
fileName,
message
}))
)
).deep.equals(
new StringifiedSet(new JSONObjectStringifier(), [
{
fileName: "includes/example_ignore.js",
message: "publish is not defined"
},
{
fileName: "definitions/has_compile_errors/assertion_with_bigquery.sqlx",
message:
'Unexpected property "bigquery" in assertion config. Supported properties are: ["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]'
},
{
fileName: "definitions/has_compile_errors/assertion_with_materialized.sqlx",
message:
'Unexpected property "materialized" in assertion config. Supported properties are: ["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]'
},
{
fileName: "definitions/has_compile_errors/assertion_with_output.sqlx",
message:
'Unexpected property "hasOutput" in assertion config. Supported properties are: ["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]'
},
{
fileName: "definitions/has_compile_errors/assertion_with_postops.sqlx",
message: "Actions may only include post_operations if they create a dataset."
},
{
fileName: "definitions/has_compile_errors/assertion_with_preops.sqlx",
message: "Actions may only include pre_operations if they create a dataset."
},
{
fileName: "definitions/has_compile_errors/assertion_with_redshift.sqlx",
message:
'Unexpected property "redshift" in assertion config. Supported properties are: ["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]'
},
{
fileName: "definitions/has_compile_errors/protected_assertion.sqlx",
message:
"Actions may only specify 'protected: true' if they are of type 'incremental'."
},
{
fileName: "definitions/has_compile_errors/protected_assertion.sqlx",
message:
'Unexpected property "protected" in assertion config. Supported properties are: ["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]'
},
{
fileName: "definitions/has_compile_errors/view_with_incremental.sqlx",
message:
"Actions may only include incremental_where if they are of type 'incremental'."
},
{
fileName: "definitions/has_compile_errors/view_with_multiple_statements.sqlx",
message:
"Actions may only contain more than one SQL statement if they are of type 'operations'."
},
{
fileName: "definitions/has_compile_errors/view_with_semi_colon_at_end.sqlx",
message: "Semi-colons are not allowed at the end of SQL statements."
},
{
fileName: "definitions/has_compile_errors/table_with_materialized.sqlx",
message:
"The 'materialized' option is only valid for Snowflake and BigQuery views"
},
{
fileName: "definitions/has_compile_errors/view_without_hermetic.sqlx",
message:
"Zero-dependency actions which create datasets are required to explicitly declare 'hermetic: (true|false)' when run caching is turned on."
}
])
);

// Check JS blocks get processed.
const exampleJsBlocks = graph.tables.find(
Expand Down Expand Up @@ -238,32 +245,6 @@ suite("examples", () => {
})
]);

const exampleUsingInline = graph.tables.find(
(t: dataform.ITable) =>
targetAsReadableString(t.target) ===
dotJoined(
databaseWithSuffix("tada-analytics"),
schemaWithSuffix("df_integration_test"),
"example_using_inline"
)
);
expect(exampleUsingInline.type).equals("table");
expect(exampleUsingInline.enumType).equals(dataform.TableType.TABLE);
expect(exampleUsingInline.query.trim()).equals(
`select * from (\n\nselect * from \`${dotJoined(
databaseWithSuffix("tada-analytics"),
schemaWithSuffix("df_integration_test"),
"sample_data"
)}\`\n)\nwhere true`
);
expect(exampleUsingInline.dependencyTargets).eql([
dataform.Target.create({
database: databaseWithSuffix("tada-analytics"),
schema: schemaWithSuffix("df_integration_test"),
name: "sample_data"
})
]);

// Check view
const exampleView = graph.tables.find(
(t: dataform.ITable) =>
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 = "2.6.2"
DF_VERSION = "2.6.3"
Loading

0 comments on commit a5ee673

Please sign in to comment.