@malloydata/render 0.0.154-dev240719231044 → 0.0.154

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.
@@ -41317,7 +41317,7 @@ class Wve extends Gve.ExpressionDef {
41317
41317
  else {
41318
41318
  const L = N[0].literal, M = Yve(L), q = M.filter((W) => W.type === "interpolation" && W.name.includes(".")).map((W) => W.type === "interpolation" ? `\${${W.name}}` : `\${${W.value}}`);
41319
41319
  if (q.length > 0) {
41320
- 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(", ")}]`;
41320
+ 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(", ")})`;
41321
41321
  return this.log(W), (0, Qa.errorFor)(`${W}. See LookML \${...} documentation at https://cloud.google.com/looker/docs/reference/param-field-sql#sql_for_dimensions`);
41322
41322
  }
41323
41323
  v = [
@@ -47345,14 +47345,14 @@ class pTe extends dTe.ExpressionDef {
47345
47345
  const f = c.when.apply(e, "=", r), x = c.pick ? c.pick.getExpression(e) : r.getExpression(e);
47346
47346
  if (o = (0, Cu.maxExpressionType)(o, (0, Cu.maxExpressionType)(f.expressionType, x.expressionType)), u = (0, Cu.mergeEvalSpaces)(u, f.evalSpace, x.evalSpace), s && !Do.FT.typeEq(s, x, !0)) {
47347
47347
  const h = Do.FT.inspect(x);
47348
- return this.log(`pick type '${h}', expected '${s.dataType}'`), (0, u0.errorFor)("pick when type");
47348
+ return this.log(`pick type '${h}', expected '${s.dataType}'[pick-values-must-match]`), (0, u0.errorFor)("pick when type");
47349
47349
  }
47350
47350
  s = aA(s, x), i.push(" WHEN ", ...f.value, " THEN ", ...x.value);
47351
47351
  }
47352
47352
  const l = (this.elsePick || r).getExpression(e);
47353
47353
  if (s = aA(s, l), !Do.FT.typeEq(s, l, !0)) {
47354
47354
  const c = this.elsePick ? "else" : "pick default";
47355
- return this.log(`${c} type '${Do.FT.inspect(l)}', expected '${s.dataType}'`), (0, u0.errorFor)("pick else type");
47355
+ return this.log(`${c} type '${Do.FT.inspect(l)}', expected '${s.dataType}'[pick-values-must-match]`), (0, u0.errorFor)("pick else type");
47356
47356
  }
47357
47357
  return {
47358
47358
  dataType: s.dataType,
@@ -47383,7 +47383,7 @@ class pTe extends dTe.ExpressionDef {
47383
47383
  return this.log(`when expression must be boolean, not '${Do.FT.inspect(a.when)}`), (0, u0.errorFor)("pick when type");
47384
47384
  if (r && !Do.FT.typeEq(r, a.pick, !0)) {
47385
47385
  const l = Do.FT.inspect(a.pick);
47386
- return this.log(`pick type '${l}', expected '${r.dataType}'`), (0, u0.errorFor)("pick value type");
47386
+ return this.log(`pick type '${l}', expected '${r.dataType}'[pick-values-must-match]`), (0, u0.errorFor)("pick value type");
47387
47387
  }
47388
47388
  r = aA(r, a.pick), s = (0, Cu.maxExpressionType)(s, (0, Cu.maxExpressionType)(a.pick.expressionType, a.when.expressionType)), o = (0, Cu.mergeEvalSpaces)(o, a.pick.evalSpace, a.when.evalSpace), i.push(" WHEN ", ...a.when.value, " THEN ", ...a.pick.value);
47389
47389
  }
@@ -47393,7 +47393,7 @@ class pTe extends dTe.ExpressionDef {
47393
47393
  expressionType: s,
47394
47394
  value: (0, Dj.compressExpr)(i),
47395
47395
  evalSpace: o
47396
- }) : (this.elsePick.log(`else type '${Do.FT.inspect(u)}', expected '${r.dataType}'`), (0, u0.errorFor)("pick value type mismatch"));
47396
+ }) : (this.elsePick.log(`else type '${Do.FT.inspect(u)}', expected '${r.dataType}'[pick-values-must-match]`), (0, u0.errorFor)("pick value type mismatch"));
47397
47397
  }
47398
47398
  }
47399
47399
  ip.Pick = pTe;
@@ -49429,7 +49429,18 @@ class yNe {
49429
49429
  getLog() {
49430
49430
  return this.rawLog;
49431
49431
  }
49432
+ /**
49433
+ * Add a message to the log.
49434
+ *
49435
+ * If the messsage ends with '[tag]', the tag is removed and stored in the `errorTag` field.
49436
+ * @param logMsg Message possibly containing an error tag
49437
+ */
49432
49438
  log(e) {
49439
+ const n = e.message;
49440
+ if (n.endsWith("]")) {
49441
+ const r = n.lastIndexOf("[");
49442
+ r > 0 && (e.message = n.slice(0, r), e.errorTag = n.slice(r + 1, -1));
49443
+ }
49433
49444
  this.rawLog.push(e);
49434
49445
  }
49435
49446
  reset() {