@malloydata/malloy-tests 0.0.141 → 0.0.142-dev240412191256

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.141",
25
- "@malloydata/db-duckdb": "^0.0.141",
26
- "@malloydata/db-postgres": "^0.0.141",
27
- "@malloydata/db-snowflake": "^0.0.141",
28
- "@malloydata/db-trino": "^0.0.141",
29
- "@malloydata/malloy": "^0.0.141",
30
- "@malloydata/render": "^0.0.141",
24
+ "@malloydata/db-bigquery": "^0.0.142-dev240412191256",
25
+ "@malloydata/db-duckdb": "^0.0.142-dev240412191256",
26
+ "@malloydata/db-postgres": "^0.0.142-dev240412191256",
27
+ "@malloydata/db-snowflake": "^0.0.142-dev240412191256",
28
+ "@malloydata/db-trino": "^0.0.142-dev240412191256",
29
+ "@malloydata/malloy": "^0.0.142-dev240412191256",
30
+ "@malloydata/render": "^0.0.142-dev240412191256",
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.141"
39
+ "version": "0.0.142-dev240412191256"
40
40
  }
@@ -661,8 +661,10 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
661
661
  });
662
662
  });
663
663
 
664
- it('joined filtered explores with dependencies', async () => {
665
- await expect(`
664
+ test.when(runtime.dialect.supportsComplexFilteredSources)(
665
+ 'joined filtered explores with dependencies',
666
+ async () => {
667
+ await expect(`
666
668
  source: bo_models is
667
669
  ${databaseName}.table('malloytest.aircraft_models') extend { where: manufacturer ? ~ 'BO%' }
668
670
  -> { select: aircraft_model_code, manufacturer, seats }
@@ -691,7 +693,8 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
691
693
  -- aggregate: b_models.bo_models.bo_count
692
694
  }
693
695
  `).malloyResultMatches(runtime, {model_count: 60461, b_count: 355});
694
- });
696
+ }
697
+ );
695
698
  });
696
699
 
697
700
  describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
@@ -1294,7 +1294,7 @@ describe.each(runtimes.runtimeList)('%s', (databaseName, runtime) => {
1294
1294
 
1295
1295
  it(`works with fanout and order_by - ${databaseName}`, async () => {
1296
1296
  // TODO bigquery cannot handle both fanout and order_by today
1297
- if (['bigquery', 'snowflake'].includes(databaseName)) return;
1297
+ if (['bigquery', 'snowflake', 'trino'].includes(databaseName)) return;
1298
1298
  await expect(`##! experimental.aggregate_order_by
1299
1299
  run: state_facts extend { join_many:
1300
1300
  state_facts2 is ${databaseName}.table('malloytest.state_facts')
@@ -905,8 +905,14 @@ SELECT row_to_json(finalStage) as row FROM __stage0 AS finalStage`);
905
905
  `).malloyResultMatches(runtime, {a: 1});
906
906
  });
907
907
 
908
+ // have to add an order_by: otherwise it isn't deterministic.
908
909
  it(`sql directly - ${databaseName}`, async () => {
909
- await expect(`run: ${sql1234}`).malloyResultMatches(runtime, {a: 1});
910
+ await expect(
911
+ `run: ${sql1234}->{
912
+ select: *
913
+ order_by: a asc
914
+ }`
915
+ ).malloyResultMatches(runtime, {a: 1});
910
916
  });
911
917
 
912
918
  it(`sql with turducken- ${databaseName}`, async () => {
@@ -988,6 +994,7 @@ SELECT row_to_json(finalStage) as row FROM __stage0 AS finalStage`);
988
994
  """) -> {
989
995
  extend: {dimension: c is b + 4}
990
996
  select: x is a * c
997
+ order_by: x desc
991
998
  }
992
999
  `).malloyResultMatches(runtime, {x: 30});
993
1000
  });
@@ -1053,6 +1060,20 @@ SELECT row_to_json(finalStage) as row FROM __stage0 AS finalStage`);
1053
1060
  }
1054
1061
  );
1055
1062
 
1063
+ test.when(runtime.supportsNesting && runtime.dialect.readsNestedData)(
1064
+ `can double unnest - ${databaseName}`,
1065
+ async () => {
1066
+ await expect(`
1067
+ source: ga_sample is ${databaseName}.table('malloytest.ga_sample')
1068
+
1069
+ run: ga_sample -> {
1070
+ aggregate:
1071
+ p is floor(hits.product.productPrice.avg())
1072
+ }
1073
+ `).malloyResultMatches(runtime, {p: 23001594});
1074
+ }
1075
+ );
1076
+
1056
1077
  test.when(runtime.supportsNesting)(
1057
1078
  'nest null - ${databaseName}',
1058
1079
  async () => {