@malloydata/malloy-tests 0.0.270-dev250424204317 → 0.0.270-dev250428164815

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-dev250424204317",
25
- "@malloydata/db-duckdb": "^0.0.270-dev250424204317",
26
- "@malloydata/db-postgres": "^0.0.270-dev250424204317",
27
- "@malloydata/db-snowflake": "^0.0.270-dev250424204317",
28
- "@malloydata/db-trino": "^0.0.270-dev250424204317",
29
- "@malloydata/malloy": "^0.0.270-dev250424204317",
30
- "@malloydata/malloy-tag": "^0.0.270-dev250424204317",
31
- "@malloydata/render": "^0.0.270-dev250424204317",
24
+ "@malloydata/db-bigquery": "^0.0.270-dev250428164815",
25
+ "@malloydata/db-duckdb": "^0.0.270-dev250428164815",
26
+ "@malloydata/db-postgres": "^0.0.270-dev250428164815",
27
+ "@malloydata/db-snowflake": "^0.0.270-dev250428164815",
28
+ "@malloydata/db-trino": "^0.0.270-dev250428164815",
29
+ "@malloydata/malloy": "^0.0.270-dev250428164815",
30
+ "@malloydata/malloy-tag": "^0.0.270-dev250428164815",
31
+ "@malloydata/render": "^0.0.270-dev250428164815",
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-dev250424204317"
41
+ "version": "0.0.270-dev250428164815"
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
- SELECT ${sizesSQL} AS ${quote('sizes')}
332
- """)`).malloyResultMatches(runtime, rec_eq());
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
- let failMsg = `QUERY RUN FAILED: ${tq.src}\nMESSAGE: ${e.message}\n`;
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 += `SQL: ${await query.getSQL()}\n`;
81
+ failMsg += `\nMESSAGE: ${e.message}\nSQL: ${await query.getSQL()}\n`;
81
82
  } catch (e2) {
82
- failMsg += `SQL FOR FAILING QUERY COULD NOT BE COMPUTED: ${e2.message}\n`;
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
  }