@malloydata/malloy-tests 0.0.216 → 0.0.217-dev241120145706

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.216",
25
- "@malloydata/db-duckdb": "^0.0.216",
26
- "@malloydata/db-postgres": "^0.0.216",
27
- "@malloydata/db-snowflake": "^0.0.216",
28
- "@malloydata/db-trino": "^0.0.216",
29
- "@malloydata/malloy": "^0.0.216",
30
- "@malloydata/render": "^0.0.216",
24
+ "@malloydata/db-bigquery": "^0.0.217-dev241120145706",
25
+ "@malloydata/db-duckdb": "^0.0.217-dev241120145706",
26
+ "@malloydata/db-postgres": "^0.0.217-dev241120145706",
27
+ "@malloydata/db-snowflake": "^0.0.217-dev241120145706",
28
+ "@malloydata/db-trino": "^0.0.217-dev241120145706",
29
+ "@malloydata/malloy": "^0.0.217-dev241120145706",
30
+ "@malloydata/render": "^0.0.217-dev241120145706",
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.216"
40
+ "version": "0.0.217-dev241120145706"
41
41
  }
@@ -15,8 +15,8 @@ afterAll(async () => {
15
15
  await runtimes.closeAll();
16
16
  });
17
17
 
18
- runtimes.runtimeMap.forEach((runtime, databaseName) => {
19
- it(`basic composite usage - ${databaseName}`, async () => {
18
+ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
19
+ it('basic composite usage', async () => {
20
20
  await expect(`
21
21
  ##! experimental.composite_sources
22
22
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -24,7 +24,7 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
24
24
  run: x -> { group_by: foo }
25
25
  `).malloyResultMatches(runtime, {foo: 1});
26
26
  });
27
- it(`composite source used in join - ${databaseName}`, async () => {
27
+ it('composite source used in join', async () => {
28
28
  await expect(`
29
29
  ##! experimental.composite_sources
30
30
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -35,7 +35,7 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
35
35
  run: y -> { group_by: x.foo }
36
36
  `).malloyResultMatches(runtime, {foo: 1});
37
37
  });
38
- it(`composite used in join on - ${databaseName}`, async () => {
38
+ it('composite used in join on', async () => {
39
39
  await expect(`
40
40
  ##! experimental.composite_sources
41
41
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -50,7 +50,7 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
50
50
  `).malloyResultMatches(runtime, {state: 'CA'});
51
51
  });
52
52
  // TODO test always join composite field usage
53
- it(`composite field used in view - ${databaseName}`, async () => {
53
+ it('composite field used in view', async () => {
54
54
  await expect(`
55
55
  ##! experimental.composite_sources
56
56
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -60,7 +60,7 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
60
60
  run: x -> v
61
61
  `).malloyResultMatches(runtime, {foo: 1});
62
62
  });
63
- it(`composite field used in view refined with scalar - ${databaseName}`, async () => {
63
+ it('composite field used in view refined with scalar', async () => {
64
64
  await expect(`
65
65
  ##! experimental.composite_sources
66
66
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -74,7 +74,7 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
74
74
  run: x -> v + foo
75
75
  `).malloyResultMatches(runtime, {foo: 1, state: 'CA'});
76
76
  });
77
- it(`composite field used in view refined with literal view - ${databaseName}`, async () => {
77
+ it('composite field used in view refined with literal view', async () => {
78
78
  await expect(`
79
79
  ##! experimental.composite_sources
80
80
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -88,7 +88,7 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
88
88
  run: x -> v + { group_by: foo }
89
89
  `).malloyResultMatches(runtime, {foo: 1, state: 'CA'});
90
90
  });
91
- it(`composite field used in refined query - ${databaseName}`, async () => {
91
+ it('composite field used in refined query', async () => {
92
92
  await expect(`
93
93
  ##! experimental.composite_sources
94
94
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -103,7 +103,7 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
103
103
  run: v + { group_by: foo }
104
104
  `).malloyResultMatches(runtime, {foo: 1, state: 'CA'});
105
105
  });
106
- it(`composite of a composite - ${databaseName}`, async () => {
106
+ it('composite of a composite', async () => {
107
107
  await expect(`
108
108
  ##! experimental.composite_sources
109
109
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -120,7 +120,7 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
120
120
  run: y -> { group_by: foo, bar }
121
121
  `).malloyResultMatches(runtime, {foo: 1, bar: 2});
122
122
  });
123
- it(`definitions from composite extension carry through - ${databaseName}`, async () => {
123
+ it('definitions from composite extension carry through', async () => {
124
124
  await expect(`
125
125
  ##! experimental.composite_sources
126
126
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -133,7 +133,7 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
133
133
  run: x -> { group_by: foo, bar }
134
134
  `).malloyResultMatches(runtime, {foo: 1, bar: 2});
135
135
  });
136
- it(`filters from composite extension carry through - ${databaseName}`, async () => {
136
+ it('filters from composite extension carry through', async () => {
137
137
  await expect(`
138
138
  ##! experimental.composite_sources
139
139
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -163,7 +163,7 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
163
163
  run: x -> { group_by: foo, bar, baz }
164
164
  `).malloyResultMatches(runtime, {foo: 1.3, bar: 2.3, baz: 3.3});
165
165
  });
166
- it(`composite with parameters - ${databaseName}`, async () => {
166
+ it('composite with parameters', async () => {
167
167
  await expect(`
168
168
  ##! experimental { composite_sources parameters }
169
169
  source: state_facts is ${databaseName}.table('malloytest.state_facts')
@@ -174,4 +174,27 @@ runtimes.runtimeMap.forEach((runtime, databaseName) => {
174
174
  run: x(param is 2) -> { group_by: b }
175
175
  `).malloyResultMatches(runtime, {b: 3});
176
176
  });
177
+ it('issue where measure defined on composite source has the wrong structPath', async () => {
178
+ await expect(`
179
+ ##! experimental { composite_sources parameters }
180
+ source: state_facts is ${databaseName}.table('malloytest.state_facts')
181
+ run: compose(state_facts, state_facts) extend {
182
+ measure: total_airport_count is airport_count.sum()
183
+ } -> {
184
+ aggregate: total_airport_count
185
+ where: state = 'CA'
186
+ }
187
+ `).malloyResultMatches(runtime, {total_airport_count: 984});
188
+ });
189
+ it('issue where query against composite source with no composite field usage does not resolve the source', async () => {
190
+ await expect(`
191
+ ##! experimental { composite_sources parameters }
192
+ source: state_facts is ${databaseName}.table('malloytest.state_facts')
193
+ run: compose(state_facts, state_facts) extend {
194
+ measure: total_airport_count is airport_count.sum()
195
+ } -> {
196
+ group_by: x is 1
197
+ }
198
+ `).malloyResultMatches(runtime, {x: 1});
199
+ });
177
200
  });