@malloydata/malloy-tests 0.0.299 → 0.0.300
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/src/core/api.spec.ts +16 -0
- package/src/databases/all/orderby.spec.ts +2 -2
- package/src/databases/bigquery/handexpr.spec.ts +255 -726
- package/src/databases/bigquery/malloy_query.spec.ts +165 -317
- package/src/models/faa_model.ts +275 -883
- package/src/models/medicare_model.ts +69 -231
- package/src/util/index.ts +0 -61
package/package.json
CHANGED
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@jest/globals": "^29.4.3",
|
|
24
|
-
"@malloydata/db-bigquery": "0.0.
|
|
25
|
-
"@malloydata/db-duckdb": "0.0.
|
|
26
|
-
"@malloydata/db-postgres": "0.0.
|
|
27
|
-
"@malloydata/db-snowflake": "0.0.
|
|
28
|
-
"@malloydata/db-trino": "0.0.
|
|
29
|
-
"@malloydata/malloy": "0.0.
|
|
30
|
-
"@malloydata/malloy-tag": "0.0.
|
|
31
|
-
"@malloydata/render": "0.0.
|
|
24
|
+
"@malloydata/db-bigquery": "0.0.300",
|
|
25
|
+
"@malloydata/db-duckdb": "0.0.300",
|
|
26
|
+
"@malloydata/db-postgres": "0.0.300",
|
|
27
|
+
"@malloydata/db-snowflake": "0.0.300",
|
|
28
|
+
"@malloydata/db-trino": "0.0.300",
|
|
29
|
+
"@malloydata/malloy": "0.0.300",
|
|
30
|
+
"@malloydata/malloy-tag": "0.0.300",
|
|
31
|
+
"@malloydata/render": "0.0.300",
|
|
32
32
|
"events": "^3.3.0",
|
|
33
33
|
"jsdom": "^22.1.0",
|
|
34
34
|
"luxon": "^2.4.0",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"@types/jsdom": "^21.1.1",
|
|
39
39
|
"@types/luxon": "^2.4.0"
|
|
40
40
|
},
|
|
41
|
-
"version": "0.0.
|
|
41
|
+
"version": "0.0.300"
|
|
42
42
|
}
|
package/src/core/api.spec.ts
CHANGED
|
@@ -39,6 +39,22 @@ if (!envDatabases.includes('duckdb')) {
|
|
|
39
39
|
describe.skip = describe;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
describe('basic', () => {
|
|
43
|
+
test('can get query by name from explore', async () => {
|
|
44
|
+
const model = runtime.loadModel(`
|
|
45
|
+
source: s1 is duckdb.table('malloytest.aircraft') extend {
|
|
46
|
+
view: v is {
|
|
47
|
+
where: state = 'CA'
|
|
48
|
+
group_by: state
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`);
|
|
52
|
+
const q1 = model.loadExploreByName('s1');
|
|
53
|
+
const oneState = await q1.loadQueryByName('v').run();
|
|
54
|
+
expect(oneState.data.path(0, 'state').value).toBe('CA');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
42
58
|
describe('extendModel', () => {
|
|
43
59
|
test('can run query in extend section', async () => {
|
|
44
60
|
const model = runtime.loadModel(`
|
|
@@ -55,9 +55,9 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
|
|
|
55
55
|
run: models->{
|
|
56
56
|
group_by:
|
|
57
57
|
manufacturer,
|
|
58
|
-
big is seats >=21
|
|
58
|
+
big is seats >= 21
|
|
59
59
|
aggregate: model_count is count()
|
|
60
|
-
}->{
|
|
60
|
+
} -> {
|
|
61
61
|
group_by: big
|
|
62
62
|
aggregate: model_count is model_count.sum()
|
|
63
63
|
}
|