@malloydata/malloy-tests 0.0.221-dev241209191943 → 0.0.221-dev241211195814

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.221-dev241209191943",
25
- "@malloydata/db-duckdb": "^0.0.221-dev241209191943",
26
- "@malloydata/db-postgres": "^0.0.221-dev241209191943",
27
- "@malloydata/db-snowflake": "^0.0.221-dev241209191943",
28
- "@malloydata/db-trino": "^0.0.221-dev241209191943",
29
- "@malloydata/malloy": "^0.0.221-dev241209191943",
30
- "@malloydata/render": "^0.0.221-dev241209191943",
24
+ "@malloydata/db-bigquery": "^0.0.221-dev241211195814",
25
+ "@malloydata/db-duckdb": "^0.0.221-dev241211195814",
26
+ "@malloydata/db-postgres": "^0.0.221-dev241211195814",
27
+ "@malloydata/db-snowflake": "^0.0.221-dev241211195814",
28
+ "@malloydata/db-trino": "^0.0.221-dev241211195814",
29
+ "@malloydata/malloy": "^0.0.221-dev241211195814",
30
+ "@malloydata/render": "^0.0.221-dev241211195814",
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.221-dev241209191943"
40
+ "version": "0.0.221-dev241211195814"
41
41
  }
@@ -35,7 +35,7 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
35
35
  run: y -> { group_by: x.foo }
36
36
  `).malloyResultMatches(runtime, {foo: 1});
37
37
  });
38
- it('composite used in join on', async () => {
38
+ it('composite field from joined source 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')
@@ -49,6 +49,41 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
49
49
  run: y -> { group_by: ca.state; where: state = 'IL' }
50
50
  `).malloyResultMatches(runtime, {state: 'CA'});
51
51
  });
52
+ it('composite field from joining source used in join on', async () => {
53
+ await expect(`
54
+ ##! experimental.composite_sources
55
+ source: state_facts is ${databaseName}.table('malloytest.state_facts')
56
+ source: x is compose(
57
+ state_facts extend {
58
+ dimension:
59
+ state_one is 'CA'
60
+ state_two is 'IL'
61
+ },
62
+ state_facts extend {
63
+ dimension: state_one is 'IL'
64
+ }
65
+ ) extend {
66
+ join_one: state_facts on state_one = state_facts.state
67
+ }
68
+ run: x -> { group_by: state_facts.state }
69
+ `).malloyResultMatches(runtime, {state: 'CA'});
70
+ });
71
+ it('query against composite resolves nested composite source even when no composite fields', async () => {
72
+ await expect(`
73
+ ##! experimental.composite_sources
74
+ source: state_facts is ${databaseName}.table('malloytest.state_facts')
75
+ source: x is compose(
76
+ compose(
77
+ state_facts,
78
+ state_facts
79
+ ),
80
+ state_facts
81
+ ) extend {
82
+ dimension: a is 1
83
+ }
84
+ run: x -> { group_by: a }
85
+ `).malloyResultMatches(runtime, {a: 1});
86
+ });
52
87
  // TODO test always join composite field usage
53
88
  it('composite field used in view', async () => {
54
89
  await expect(`
@@ -208,4 +243,14 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
208
243
  }
209
244
  `).malloyResultMatches(runtime, {'foo.x': 1});
210
245
  });
246
+ it('composite with select *', async () => {
247
+ await expect(`
248
+ ##! experimental.composite_sources
249
+ source: state_facts is ${databaseName}.table('malloytest.state_facts')
250
+ source: x is compose(state_facts, state_facts extend { dimension: foo is 1 }) extend {
251
+ accept: foo
252
+ }
253
+ run: x -> { select: * }
254
+ `).malloyResultMatches(runtime, {foo: 1});
255
+ });
211
256
  });