@malloydata/malloy-tests 0.0.186 → 0.0.187-dev240919195052

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.186",
25
- "@malloydata/db-duckdb": "^0.0.186",
26
- "@malloydata/db-postgres": "^0.0.186",
27
- "@malloydata/db-snowflake": "^0.0.186",
28
- "@malloydata/db-trino": "^0.0.186",
29
- "@malloydata/malloy": "^0.0.186",
30
- "@malloydata/render": "^0.0.186",
24
+ "@malloydata/db-bigquery": "^0.0.187-dev240919195052",
25
+ "@malloydata/db-duckdb": "^0.0.187-dev240919195052",
26
+ "@malloydata/db-postgres": "^0.0.187-dev240919195052",
27
+ "@malloydata/db-snowflake": "^0.0.187-dev240919195052",
28
+ "@malloydata/db-trino": "^0.0.187-dev240919195052",
29
+ "@malloydata/malloy": "^0.0.187-dev240919195052",
30
+ "@malloydata/render": "^0.0.187-dev240919195052",
31
31
  "jsdom": "^22.1.0",
32
32
  "luxon": "^2.4.0",
33
33
  "madge": "^6.0.0"
@@ -36,5 +36,5 @@
36
36
  "@types/jsdom": "^21.1.1",
37
37
  "@types/luxon": "^2.4.0"
38
38
  },
39
- "version": "0.0.186"
39
+ "version": "0.0.187-dev240919195052"
40
40
  }
@@ -1088,10 +1088,9 @@ expressionModels.forEach((x, databaseName) => {
1088
1088
  });
1089
1089
 
1090
1090
  describe('count_approx', () => {
1091
- test.when(runtime.dialect.supportsCountApprox)(
1092
- 'works generally',
1093
- async () => {
1094
- await expect(`
1091
+ const supported = runtime.dialect.supportsCountApprox;
1092
+ test.when(supported)('works generally', async () => {
1093
+ await expect(`
1095
1094
  // be accurate within 30%
1096
1095
  // # test.debug
1097
1096
  run: ${databaseName}.table('malloytest.state_facts') -> {
@@ -1099,11 +1098,21 @@ expressionModels.forEach((x, databaseName) => {
1099
1098
  aggregate: also_passes is abs(count_approx(airport_count)-count(airport_count))/count(airport_count) < 0.3
1100
1099
  }
1101
1100
  `).malloyResultMatches(runtime, {
1102
- 'passes': true,
1103
- 'also_passes': true,
1104
- });
1105
- }
1106
- );
1101
+ 'passes': true,
1102
+ 'also_passes': true,
1103
+ });
1104
+ });
1105
+ test.when(supported)('works with fanout', async () => {
1106
+ await expect(`
1107
+ source: state_facts is ${databaseName}.table('malloytest.state_facts')
1108
+ source: state_facts_fanout is ${databaseName}.table('malloytest.state_facts') extend {
1109
+ join_cross: state_facts on true
1110
+ }
1111
+ run: state_facts_fanout -> {
1112
+ aggregate: x is state_facts.state.count_approx() > 0
1113
+ }
1114
+ `).malloyResultMatches(runtime, {x: true});
1115
+ });
1107
1116
  });
1108
1117
  describe('last_value', () => {
1109
1118
  it(`works - ${databaseName}`, async () => {