@malloydata/malloy 0.0.286 → 0.0.288

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.
@@ -281,6 +281,7 @@ class Drill extends filters_1.Filter {
281
281
  const exprCond = {
282
282
  node: 'filterCondition',
283
283
  code: filter.exprSrc,
284
+ isSourceFilter: false,
284
285
  e: collectedWheres === undefined
285
286
  ? fExpr.value
286
287
  : {
@@ -75,6 +75,7 @@ class FilterElement extends malloy_element_1.MalloyElement {
75
75
  e: { node: 'false' },
76
76
  expressionType: 'scalar',
77
77
  fieldUsage: exprVal.fieldUsage,
78
+ isSourceFilter: false,
78
79
  };
79
80
  }
80
81
  const stableFilter = this.getStableFilter();
@@ -85,6 +86,7 @@ class FilterElement extends malloy_element_1.MalloyElement {
85
86
  expressionType: exprVal.expressionType,
86
87
  fieldUsage: exprVal.fieldUsage,
87
88
  stableFilter,
89
+ isSourceFilter: false,
88
90
  };
89
91
  return exprCond;
90
92
  }
@@ -147,7 +147,10 @@ class RefinedSource extends source_1.Source {
147
147
  el.logError('aggregate-in-source-filter', "Can't use aggregate computations in top level filters");
148
148
  }
149
149
  else {
150
- filterList.push(fc);
150
+ filterList.push({
151
+ ...fc,
152
+ isSourceFilter: true,
153
+ });
151
154
  moreFilters = true;
152
155
  }
153
156
  }
@@ -62,6 +62,7 @@ export interface FilterCondition extends ExprE {
62
62
  fieldUsage?: FieldUsage[];
63
63
  drillView?: string;
64
64
  stableFilter?: Filter;
65
+ isSourceFilter?: boolean;
65
66
  }
66
67
  export interface FilteredExpr extends ExprWithKids {
67
68
  node: 'filteredExpr';
package/dist/to_stable.js CHANGED
@@ -206,7 +206,6 @@ function convertFieldInfos(source, fields) {
206
206
  return result;
207
207
  }
208
208
  function getResultMetadataAnnotation(field, resultMetadata) {
209
- var _a;
210
209
  const tag = malloy_tag_1.Tag.withPrefix('#(malloy) ');
211
210
  let hasAny = false;
212
211
  if (resultMetadata.referenceId !== undefined) {
@@ -227,9 +226,8 @@ function getResultMetadataAnnotation(field, resultMetadata) {
227
226
  hasAny = true;
228
227
  }
229
228
  }
230
- const drillFilters = (_a = resultMetadata.filterList) === null || _a === void 0 ? void 0 : _a.filter(f => f.expressionType === 'scalar');
231
- if (drillFilters) {
232
- addDrillFiltersTag(tag, drillFilters);
229
+ if (resultMetadata.filterList) {
230
+ addDrillFiltersTag(tag, resultMetadata.filterList);
233
231
  hasAny = true;
234
232
  }
235
233
  if (resultMetadata.fieldKind === 'dimension') {
@@ -253,6 +251,8 @@ function addDrillFiltersTag(tag, drillFilters) {
253
251
  var _a;
254
252
  for (let i = 0; i < drillFilters.length; i++) {
255
253
  const filter = drillFilters[i];
254
+ if (filter.expressionType !== 'scalar' || filter.isSourceFilter)
255
+ continue;
256
256
  tag.set(['drill_filters', i, 'code'], filter.code);
257
257
  if (filter.drillView) {
258
258
  tag.set(['drill_filters', i, 'drill_view'], filter.drillView);
@@ -309,16 +309,15 @@ function identifierCode(name) {
309
309
  return `\`${escapeIdentifier(name)}\``;
310
310
  }
311
311
  function getResultStructMetadataAnnotation(field, resultMetadata) {
312
- var _a, _b, _c;
312
+ var _a, _b;
313
313
  const tag = malloy_tag_1.Tag.withPrefix('#(malloy) ');
314
314
  let hasAny = false;
315
315
  if (resultMetadata.limit !== undefined) {
316
316
  tag.set(['limit'], resultMetadata.limit);
317
317
  hasAny = true;
318
318
  }
319
- const drillFilters = (_a = resultMetadata.filterList) === null || _a === void 0 ? void 0 : _a.filter(f => f.expressionType === 'scalar');
320
- if (drillFilters) {
321
- addDrillFiltersTag(tag, drillFilters);
319
+ if (resultMetadata.filterList) {
320
+ addDrillFiltersTag(tag, resultMetadata.filterList);
322
321
  hasAny = true;
323
322
  }
324
323
  if (resultMetadata.drillable) {
@@ -329,9 +328,9 @@ function getResultStructMetadataAnnotation(field, resultMetadata) {
329
328
  for (let i = 0; i < resultMetadata.orderBy.length; i++) {
330
329
  const orderBy = resultMetadata.orderBy[i];
331
330
  const orderByField = typeof orderBy.field === 'number'
332
- ? (_b = field.fields[orderBy.field - 1].as) !== null && _b !== void 0 ? _b : field.fields[orderBy.field - 1].name
331
+ ? (_a = field.fields[orderBy.field - 1].as) !== null && _a !== void 0 ? _a : field.fields[orderBy.field - 1].name
333
332
  : orderBy.field;
334
- const direction = (_c = orderBy.dir) !== null && _c !== void 0 ? _c : null;
333
+ const direction = (_b = orderBy.dir) !== null && _b !== void 0 ? _b : null;
335
334
  tag.set(['ordered_by', i, orderByField], direction);
336
335
  }
337
336
  hasAny = true;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const MALLOY_VERSION = "0.0.286";
1
+ export declare const MALLOY_VERSION = "0.0.288";
package/dist/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MALLOY_VERSION = void 0;
4
4
  // generated with 'generate-version-file' script; do not edit manually
5
- exports.MALLOY_VERSION = '0.0.286';
5
+ exports.MALLOY_VERSION = '0.0.288';
6
6
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.286",
3
+ "version": "0.0.288",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -41,9 +41,9 @@
41
41
  "generate-version-file": "VERSION=$(npm pkg get version --workspaces=false | tr -d \\\")\necho \"// generated with 'generate-version-file' script; do not edit manually\\nexport const MALLOY_VERSION = '$VERSION';\" > src/version.ts"
42
42
  },
43
43
  "dependencies": {
44
- "@malloydata/malloy-filter": "0.0.286",
45
- "@malloydata/malloy-interfaces": "0.0.286",
46
- "@malloydata/malloy-tag": "0.0.286",
44
+ "@malloydata/malloy-filter": "0.0.288",
45
+ "@malloydata/malloy-interfaces": "0.0.288",
46
+ "@malloydata/malloy-tag": "0.0.288",
47
47
  "antlr4ts": "^0.5.0-alpha.4",
48
48
  "assert": "^2.0.0",
49
49
  "jaro-winkler": "^0.2.8",