@malloydata/malloy-tests 0.0.306 → 0.0.308

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.306",
25
- "@malloydata/db-duckdb": "0.0.306",
26
- "@malloydata/db-postgres": "0.0.306",
27
- "@malloydata/db-snowflake": "0.0.306",
28
- "@malloydata/db-trino": "0.0.306",
29
- "@malloydata/malloy": "0.0.306",
30
- "@malloydata/malloy-tag": "0.0.306",
31
- "@malloydata/render": "0.0.306",
24
+ "@malloydata/db-bigquery": "0.0.308",
25
+ "@malloydata/db-duckdb": "0.0.308",
26
+ "@malloydata/db-postgres": "0.0.308",
27
+ "@malloydata/db-snowflake": "0.0.308",
28
+ "@malloydata/db-trino": "0.0.308",
29
+ "@malloydata/malloy": "0.0.308",
30
+ "@malloydata/malloy-tag": "0.0.308",
31
+ "@malloydata/render": "0.0.308",
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.306"
41
+ "version": "0.0.308"
42
42
  }
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright Contributors to the Malloy project
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ import {runtimeFor} from '../runtimes';
7
+ import '../util/db-jest-matchers';
8
+
9
+ const runtime = runtimeFor('duckdb');
10
+
11
+ describe('misc tests for regressions that have no better home', () => {
12
+ test('rename a field in a join', async () => {
13
+ // Previously the rename would cause an error in the prepare step, so any result is good
14
+ await expect(`
15
+ source: carriers is duckdb.table('malloytest.carriers') extend { rename: airline is name }
16
+ run: duckdb.table('malloytest.flights') extend {
17
+ join_one: carriers on carrier = carriers.code
18
+ } -> { group_by: carriers.airline; limit: 1 }
19
+ `).malloyResultMatches(runtime, [{}]);
20
+ });
21
+ });
@@ -441,6 +441,20 @@ describe.each(runtimes.runtimeList)(
441
441
  }
442
442
  `).malloyResultMatches(runtime, {x: 'Mark'});
443
443
  });
444
+ test('record in join references join fields', async () => {
445
+ const id = quote('id');
446
+ const x = quote('x');
447
+ const y = quote('y');
448
+ await expect(`
449
+ source: joined_data is ${conName}.sql("""
450
+ SELECT 1 as ${id}, 10 as ${x}, 20 as ${y}
451
+ """) extend { dimension: rec is {xysum is x + y} }
452
+ source: base is ${conName}.sql("""SELECT 1 as ${id} """) extend {
453
+ join_one: jd is joined_data on jd.id = id
454
+ }
455
+ run: base -> { select: result is jd.rec.xysum }
456
+ `).malloyResultMatches(runtime, {result: 30});
457
+ });
444
458
  });
445
459
  describe('repeated record', () => {
446
460
  const abType: ArrayTypeDef = {