@malloydata/render 0.0.153 → 0.0.154-dev240722014518

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.
@@ -40495,7 +40495,7 @@ class w_e extends F_e.ExpressionDef {
40495
40495
  else {
40496
40496
  const L = O[0].literal, M = I_e(L), q = M.filter((W) => W.type === "interpolation" && W.name.includes(".")).map((W) => W.type === "interpolation" ? `\${${W.name}}` : `\${${W.value}}`);
40497
40497
  if (q.length > 0) {
40498
- const W = q.length === 1 ? `'.' paths are not yet supported in sql interpolations, found ${q.at(0)}` : `'.' paths are not yet supported in sql interpolations, found [${q.join(", ")}]`;
40498
+ const W = q.length === 1 ? `'.' paths are not yet supported in sql interpolations, found ${q.at(0)}` : `'.' paths are not yet supported in sql interpolations, found (${q.join(", ")})`;
40499
40499
  return this.log(W), (0, Xa.errorFor)(`${W}. See LookML \${...} documentation at https://cloud.google.com/looker/docs/reference/param-field-sql#sql_for_dimensions`);
40500
40500
  }
40501
40501
  S = [
@@ -46281,14 +46281,14 @@ class tTe extends Zbe.ExpressionDef {
46281
46281
  const f = c.when.apply(e, "=", r), x = c.pick ? c.pick.getExpression(e) : r.getExpression(e);
46282
46282
  if (o = (0, Du.maxExpressionType)(o, (0, Du.maxExpressionType)(f.expressionType, x.expressionType)), u = (0, Du.mergeEvalSpaces)(u, f.evalSpace, x.evalSpace), s && !Bo.FT.typeEq(s, x, !0)) {
46283
46283
  const h = Bo.FT.inspect(x);
46284
- return this.log(`pick type '${h}', expected '${s.dataType}'`), (0, d0.errorFor)("pick when type");
46284
+ return this.log(`pick type '${h}', expected '${s.dataType}'[pick-values-must-match]`), (0, d0.errorFor)("pick when type");
46285
46285
  }
46286
46286
  s = TA(s, x), i.push(" WHEN ", ...f.value, " THEN ", ...x.value);
46287
46287
  }
46288
46288
  const l = (this.elsePick || r).getExpression(e);
46289
46289
  if (s = TA(s, l), !Bo.FT.typeEq(s, l, !0)) {
46290
46290
  const c = this.elsePick ? "else" : "pick default";
46291
- return this.log(`${c} type '${Bo.FT.inspect(l)}', expected '${s.dataType}'`), (0, d0.errorFor)("pick else type");
46291
+ return this.log(`${c} type '${Bo.FT.inspect(l)}', expected '${s.dataType}'[pick-values-must-match]`), (0, d0.errorFor)("pick else type");
46292
46292
  }
46293
46293
  return {
46294
46294
  dataType: s.dataType,
@@ -46319,7 +46319,7 @@ class tTe extends Zbe.ExpressionDef {
46319
46319
  return this.log(`when expression must be boolean, not '${Bo.FT.inspect(a.when)}`), (0, d0.errorFor)("pick when type");
46320
46320
  if (r && !Bo.FT.typeEq(r, a.pick, !0)) {
46321
46321
  const l = Bo.FT.inspect(a.pick);
46322
- return this.log(`pick type '${l}', expected '${r.dataType}'`), (0, d0.errorFor)("pick value type");
46322
+ return this.log(`pick type '${l}', expected '${r.dataType}'[pick-values-must-match]`), (0, d0.errorFor)("pick value type");
46323
46323
  }
46324
46324
  r = TA(r, a.pick), s = (0, Du.maxExpressionType)(s, (0, Du.maxExpressionType)(a.pick.expressionType, a.when.expressionType)), o = (0, Du.mergeEvalSpaces)(o, a.pick.evalSpace, a.when.evalSpace), i.push(" WHEN ", ...a.when.value, " THEN ", ...a.pick.value);
46325
46325
  }
@@ -46329,7 +46329,7 @@ class tTe extends Zbe.ExpressionDef {
46329
46329
  expressionType: s,
46330
46330
  value: (0, iq.compressExpr)(i),
46331
46331
  evalSpace: o
46332
- }) : (this.elsePick.log(`else type '${Bo.FT.inspect(u)}', expected '${r.dataType}'`), (0, d0.errorFor)("pick value type mismatch"));
46332
+ }) : (this.elsePick.log(`else type '${Bo.FT.inspect(u)}', expected '${r.dataType}'[pick-values-must-match]`), (0, d0.errorFor)("pick value type mismatch"));
46333
46333
  }
46334
46334
  }
46335
46335
  g2.Pick = tTe;
@@ -48365,7 +48365,18 @@ class iOe {
48365
48365
  getLog() {
48366
48366
  return this.rawLog;
48367
48367
  }
48368
+ /**
48369
+ * Add a message to the log.
48370
+ *
48371
+ * If the messsage ends with '[tag]', the tag is removed and stored in the `errorTag` field.
48372
+ * @param logMsg Message possibly containing an error tag
48373
+ */
48368
48374
  log(e) {
48375
+ const n = e.message;
48376
+ if (n.endsWith("]")) {
48377
+ const r = n.lastIndexOf("[");
48378
+ r > 0 && (e.message = n.slice(0, r), e.errorTag = n.slice(r + 1, -1));
48379
+ }
48369
48380
  this.rawLog.push(e);
48370
48381
  }
48371
48382
  reset() {