@malloydata/malloy-tests 0.0.197-dev241009193540 → 0.0.197-dev241010003320
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,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@jest/globals": "^29.4.3",
|
|
24
|
-
"@malloydata/db-bigquery": "^0.0.197-
|
|
25
|
-
"@malloydata/db-duckdb": "^0.0.197-
|
|
26
|
-
"@malloydata/db-postgres": "^0.0.197-
|
|
27
|
-
"@malloydata/db-snowflake": "^0.0.197-
|
|
28
|
-
"@malloydata/db-trino": "^0.0.197-
|
|
29
|
-
"@malloydata/malloy": "^0.0.197-
|
|
30
|
-
"@malloydata/render": "^0.0.197-
|
|
24
|
+
"@malloydata/db-bigquery": "^0.0.197-dev241010003320",
|
|
25
|
+
"@malloydata/db-duckdb": "^0.0.197-dev241010003320",
|
|
26
|
+
"@malloydata/db-postgres": "^0.0.197-dev241010003320",
|
|
27
|
+
"@malloydata/db-snowflake": "^0.0.197-dev241010003320",
|
|
28
|
+
"@malloydata/db-trino": "^0.0.197-dev241010003320",
|
|
29
|
+
"@malloydata/malloy": "^0.0.197-dev241010003320",
|
|
30
|
+
"@malloydata/render": "^0.0.197-dev241010003320",
|
|
31
31
|
"events": "^3.3.0",
|
|
32
32
|
"jsdom": "^22.1.0",
|
|
33
33
|
"luxon": "^2.4.0",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"@types/jsdom": "^21.1.1",
|
|
38
38
|
"@types/luxon": "^2.4.0"
|
|
39
39
|
},
|
|
40
|
-
"version": "0.0.197-
|
|
40
|
+
"version": "0.0.197-dev241010003320"
|
|
41
41
|
}
|
|
@@ -410,18 +410,26 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
|
|
|
410
410
|
`).malloyResultMatches(expressionModel, {a: 312});
|
|
411
411
|
});
|
|
412
412
|
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
it('sql safe cast', async () => {
|
|
414
|
+
const safeCast = `
|
|
415
415
|
run: ${databaseName}.sql('SELECT 1 as one') -> { select:
|
|
416
416
|
bad_date is '12a':::date
|
|
417
417
|
bad_number is 'abc':::number
|
|
418
418
|
good_number is "312":::"${nativeInt}"
|
|
419
419
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
420
|
+
`;
|
|
421
|
+
if (runtime.dialect.supportsSafeCast) {
|
|
422
|
+
await expect(safeCast).malloyResultMatches(runtime, {
|
|
423
|
+
bad_date: null,
|
|
424
|
+
bad_number: null,
|
|
425
|
+
good_number: 312,
|
|
426
|
+
});
|
|
427
|
+
} else {
|
|
428
|
+
await expect(safeCast).toEmitDuringTranslation(runtime, {
|
|
429
|
+
id: 'translation-error',
|
|
430
|
+
data: {code: 'dialect-cast-unsafe-only'},
|
|
431
|
+
});
|
|
432
|
+
}
|
|
425
433
|
});
|
|
426
434
|
|
|
427
435
|
it('many_field.sum() has correct locality', async () => {
|