@malloydata/malloy-tests 0.0.270-dev250424172451 → 0.0.270-dev250426032717
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.270-
|
|
25
|
-
"@malloydata/db-duckdb": "^0.0.270-
|
|
26
|
-
"@malloydata/db-postgres": "^0.0.270-
|
|
27
|
-
"@malloydata/db-snowflake": "^0.0.270-
|
|
28
|
-
"@malloydata/db-trino": "^0.0.270-
|
|
29
|
-
"@malloydata/malloy": "^0.0.270-
|
|
30
|
-
"@malloydata/malloy-tag": "^0.0.270-
|
|
31
|
-
"@malloydata/render": "^0.0.270-
|
|
24
|
+
"@malloydata/db-bigquery": "^0.0.270-dev250426032717",
|
|
25
|
+
"@malloydata/db-duckdb": "^0.0.270-dev250426032717",
|
|
26
|
+
"@malloydata/db-postgres": "^0.0.270-dev250426032717",
|
|
27
|
+
"@malloydata/db-snowflake": "^0.0.270-dev250426032717",
|
|
28
|
+
"@malloydata/db-trino": "^0.0.270-dev250426032717",
|
|
29
|
+
"@malloydata/malloy": "^0.0.270-dev250426032717",
|
|
30
|
+
"@malloydata/malloy-tag": "^0.0.270-dev250426032717",
|
|
31
|
+
"@malloydata/render": "^0.0.270-dev250426032717",
|
|
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.270-
|
|
41
|
+
"version": "0.0.270-dev250426032717"
|
|
42
42
|
}
|
|
@@ -328,8 +328,8 @@ describe.each(runtimes.runtimeList)(
|
|
|
328
328
|
'can read schema of record object',
|
|
329
329
|
async () => {
|
|
330
330
|
await expect(`run: ${conName}.sql("""
|
|
331
|
-
|
|
332
|
-
|
|
331
|
+
SELECT ${sizesSQL} AS ${quote('sizes')}
|
|
332
|
+
""")`).malloyResultMatches(runtime, rec_eq());
|
|
333
333
|
}
|
|
334
334
|
);
|
|
335
335
|
test('simple record.property access', async () => {
|
|
@@ -339,6 +339,14 @@ describe.each(runtimes.runtimeList)(
|
|
|
339
339
|
{small: 0}
|
|
340
340
|
);
|
|
341
341
|
});
|
|
342
|
+
test('property accessed from aliased record dimension', async () => {
|
|
343
|
+
await expect(`
|
|
344
|
+
source: sx is ${sizes} extend {
|
|
345
|
+
dimension: copy_sizes is sizes
|
|
346
|
+
}
|
|
347
|
+
run: sx -> {select: xl is copy_sizes.xl}
|
|
348
|
+
`).matchesRows(runtime, {xl: 3});
|
|
349
|
+
});
|
|
342
350
|
test('nested data looks like a record', async () => {
|
|
343
351
|
await expect(`
|
|
344
352
|
run: ${conName}.sql('SELECT 1 as ${quote('o')}') -> {
|
|
@@ -69,7 +69,8 @@ export async function runQuery(
|
|
|
69
69
|
try {
|
|
70
70
|
result = await query.run();
|
|
71
71
|
} catch (e) {
|
|
72
|
-
|
|
72
|
+
const src = tq.src.replace(/^\n+/m, '').trimEnd();
|
|
73
|
+
let failMsg = `QUERY RUN FAILED:\n${src}`;
|
|
73
74
|
if (e instanceof MalloyError) {
|
|
74
75
|
failMsg = `Error in query compilation\n${errorLogToString(
|
|
75
76
|
tq.src,
|
|
@@ -77,11 +78,13 @@ export async function runQuery(
|
|
|
77
78
|
)}`;
|
|
78
79
|
} else {
|
|
79
80
|
try {
|
|
80
|
-
failMsg +=
|
|
81
|
+
failMsg += `\nMESSAGE: ${e.message}\nSQL: ${await query.getSQL()}\n`;
|
|
81
82
|
} catch (e2) {
|
|
82
|
-
failMsg +=
|
|
83
|
+
failMsg += '\nSQL FOR QUERY COULD NOT BE COMPUTED\n';
|
|
84
|
+
}
|
|
85
|
+
if (e.stack) {
|
|
86
|
+
failMsg += `STACK:\n${e.stack}\n`;
|
|
83
87
|
}
|
|
84
|
-
failMsg += e.stack;
|
|
85
88
|
}
|
|
86
89
|
return {fail: {pass: false, message: () => failMsg}, query};
|
|
87
90
|
}
|