@malloydata/malloy 0.0.121-dev240202013951 → 0.0.121-dev240202151424

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.
@@ -120,8 +120,9 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
120
120
  }
121
121
  inExperiment(experimentID, cx) {
122
122
  const experimental = this.compilerFlags.tag('experimental');
123
- if (experimental) {
124
- return experimental.bare() || experimental.has(experimentID);
123
+ if (experimental &&
124
+ (experimental.bare() || experimental.has(experimentID))) {
125
+ return true;
125
126
  }
126
127
  this.contextError(cx, `Experimental flag '${experimentID}' required to enable this feature`);
127
128
  return false;
@@ -173,6 +173,17 @@ describe('expressions', () => {
173
173
  }
174
174
  `).translationToFailWith("Experimental flag 'function_order_by' required to enable this feature", "Experimental flag 'partition_by' required to enable this feature", "Experimental flag 'aggregate_limit' required to enable this feature");
175
175
  });
176
+ test('props not allowed with different experiment enabled', () => {
177
+ expect((0, test_translator_1.markSource) `
178
+ ##! experimental.something_else
179
+ run: a -> {
180
+ group_by: ai
181
+ group_by: x1 is string_agg(astr) { order_by: ai }
182
+ group_by: x2 is lag(ai) { partition_by: ai }
183
+ group_by: x3 is string_agg(astr) { limit: 10 }
184
+ }
185
+ `).translationToFailWith("Experimental flag 'function_order_by' required to enable this feature", "Experimental flag 'partition_by' required to enable this feature", "Experimental flag 'aggregate_limit' required to enable this feature");
186
+ });
176
187
  test('props not allowed on most expressions', () => {
177
188
  expect((0, test_translator_1.markSource) `
178
189
  ##! experimental { function_order_by partition_by aggregate_limit }
@@ -71,6 +71,9 @@ describe('model statements', () => {
71
71
  test('experimental explicit enable', () => {
72
72
  expect('##! experimental { compilerTestExperimentParse compilerTestExperimentTranslate }\n;;[ "x" ]').toTranslate();
73
73
  });
74
+ test('experiments do not bleed into one another', () => {
75
+ expect('##! experimental { this_experiment_does_not_exist }\n;;[ "x" ]').translationToFailWith("Experimental flag 'compilerTestExperimentParse' required to enable this feature");
76
+ });
74
77
  test('experiment failures in parse are flagged', () => {
75
78
  expect(';;[ "x" ]').translationToFailWith("Experimental flag 'compilerTestExperimentParse' required to enable this feature");
76
79
  });
@@ -1267,7 +1267,7 @@ class FieldInstanceResultRoot extends FieldInstanceResult {
1267
1267
  // group_by: user_id
1268
1268
  // aggregate: order_count is orders.count()
1269
1269
  if (join.leafiest) {
1270
- if (join.parent !== null &&
1270
+ if (join.parent !== undefined &&
1271
1271
  join.uniqueKeyPossibleUses.has('count') &&
1272
1272
  !join.queryStruct.primaryKey()) {
1273
1273
  join.makeUniqueKey = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.121-dev240202013951",
3
+ "version": "0.0.121-dev240202151424",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",