@malloydata/malloy-tests 0.0.270 → 0.0.271-experiment-250430155127
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
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.271-experiment-250430155127",
|
|
25
|
+
"@malloydata/db-duckdb": "^0.0.271-experiment-250430155127",
|
|
26
|
+
"@malloydata/db-postgres": "^0.0.271-experiment-250430155127",
|
|
27
|
+
"@malloydata/db-snowflake": "^0.0.271-experiment-250430155127",
|
|
28
|
+
"@malloydata/db-trino": "^0.0.271-experiment-250430155127",
|
|
29
|
+
"@malloydata/malloy": "^0.0.271-experiment-250430155127",
|
|
30
|
+
"@malloydata/malloy-tag": "^0.0.271-experiment-250430155127",
|
|
31
|
+
"@malloydata/render": "^0.0.271-experiment-250430155127",
|
|
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.271-experiment-250430155127"
|
|
42
42
|
}
|
|
@@ -345,4 +345,20 @@ describe('parameters', () => {
|
|
|
345
345
|
`
|
|
346
346
|
).malloyResultMatches(runtime, {param_value: 10});
|
|
347
347
|
});
|
|
348
|
+
// TODO fix this when we redo namespaces
|
|
349
|
+
it.skip('default value not passed through extension propagates, with composite source', async () => {
|
|
350
|
+
await expect(
|
|
351
|
+
`
|
|
352
|
+
##! experimental { parameters composite_sources }
|
|
353
|
+
source: ab_new(param::number is 10) is compose(
|
|
354
|
+
duckdb.table('malloytest.state_facts'),
|
|
355
|
+
duckdb.table('malloytest.state_facts') extend { dimension: foo is 1 }
|
|
356
|
+
) extend {
|
|
357
|
+
dimension: param_value is param
|
|
358
|
+
}
|
|
359
|
+
source: ab_new_new is ab_new extend {}
|
|
360
|
+
run: ab_new_new -> { group_by: param_value, foo }
|
|
361
|
+
`
|
|
362
|
+
).malloyResultMatches(runtime, {param_value: 10});
|
|
363
|
+
});
|
|
348
364
|
});
|
|
@@ -448,4 +448,34 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
|
|
|
448
448
|
run: x(param is 2) -> { group_by: b }
|
|
449
449
|
`).malloyResultMatches(wrappedRuntime, {b: 3});
|
|
450
450
|
});
|
|
451
|
+
// TODO still need to fix this
|
|
452
|
+
it.skip('nested composite where field usage depends on which composite selected', async () => {
|
|
453
|
+
await expect(`
|
|
454
|
+
##! experimental.composite_sources
|
|
455
|
+
source: state_facts is ${databaseName}.table('malloytest.state_facts')
|
|
456
|
+
source: x is compose(
|
|
457
|
+
compose(
|
|
458
|
+
state_facts extend {
|
|
459
|
+
dimension: a is 'a1'
|
|
460
|
+
},
|
|
461
|
+
state_facts extend {
|
|
462
|
+
dimension: b is 'b1'
|
|
463
|
+
}
|
|
464
|
+
) extend {
|
|
465
|
+
dimension: x is b
|
|
466
|
+
},
|
|
467
|
+
compose(
|
|
468
|
+
state_facts extend {
|
|
469
|
+
dimension: a is 'a2'
|
|
470
|
+
},
|
|
471
|
+
state_facts extend {
|
|
472
|
+
dimension: b is 'b2'
|
|
473
|
+
}
|
|
474
|
+
) extend {
|
|
475
|
+
dimension: x is b
|
|
476
|
+
}
|
|
477
|
+
)
|
|
478
|
+
run: x -> { group_by: x }
|
|
479
|
+
`).malloyResultMatches(runtime, {x: 'b1'});
|
|
480
|
+
});
|
|
451
481
|
});
|
|
@@ -28,6 +28,7 @@ import {databasesFromEnvironmentOr} from '../../util';
|
|
|
28
28
|
import '../../util/db-jest-matchers';
|
|
29
29
|
|
|
30
30
|
const runtimes = new RuntimeList(databasesFromEnvironmentOr(allDatabases));
|
|
31
|
+
|
|
31
32
|
function modelText(connectionName: string) {
|
|
32
33
|
return `
|
|
33
34
|
source: aircraft_models is ${connectionName}.table('malloytest.aircraft_models') extend {
|
|
@@ -60,7 +60,7 @@ export async function runQuery(
|
|
|
60
60
|
fail: {
|
|
61
61
|
pass: false,
|
|
62
62
|
message: () =>
|
|
63
|
-
`Could not prepare query to run: ${e.message}\n\nQUERY:\n${queryText}`,
|
|
63
|
+
`Could not prepare query to run: ${e.message}\n\nQUERY:\n${queryText}\n\nSTACK:\n${e.stack}`,
|
|
64
64
|
},
|
|
65
65
|
};
|
|
66
66
|
}
|