From c040089f8d88daaa816933fc00423796cf7c6617 Mon Sep 17 00:00:00 2001 From: alosslessdev Date: Thu, 5 Nov 2026 11:36:02 -0500 Subject: [PATCH] dax: clear NAMEOF's volatile flag, infer Pow as Decimal and widen the scope note (#2228) --- crates/dax/src/functions/information.rs | 2 +- crates/dax/src/types.rs | 4 +++- docs/dax-functions.md | 15 ++++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/crates/dax/src/functions/information.rs b/crates/dax/src/functions/information.rs index 305e90ede..6a18e086d 100644 --- a/crates/dax/src/functions/information.rs +++ b/crates/dax/src/functions/information.rs @@ -851,7 +851,7 @@ pub static FUNCTIONS: &[FunctionSpec] = &[ overload(&[ParamKind::Reference, ParamKind::Text, ParamKind::Text]), ], ReturnType::String, - FunctionFlags::new(false, true, false, false, true), + FunctionFlags::new(false, false, false, false, true), "Text name of a table, column, measure or calendar. Component selects TABLE, COLUMN, \ MEASURE, CALENDAR, FULL, SELF or PARENT; Escaped selects ESCAPED, UNESCAPED or \ MINIMALLYESCAPED. Variables and dynamic expressions are not accepted.", diff --git a/crates/dax/src/types.rs b/crates/dax/src/types.rs index d7c906159..e1c965eb4 100644 --- a/crates/dax/src/types.rs +++ b/crates/dax/src/types.rs @@ -560,7 +560,9 @@ fn blank_arithmetic(op: BinaryOp, left: InferredType, right: InferredType) -> Re Ok(InferredType::Unknown) } } - BinaryOp::Pow => Ok(InferredType::Blank), + // The evaluator coerces a BLANK operand to 0 and answers a number, so exponentiation is + // Decimal rather than Blank. + BinaryOp::Pow => Ok(InferredType::Data(DataType::Decimal)), _ => Err(TypeError::IncompatibleOperands { op, left, right }), } } diff --git a/docs/dax-functions.md b/docs/dax-functions.md index e682f1f73..f28de8cbe 100644 --- a/docs/dax-functions.md +++ b/docs/dax-functions.md @@ -33,13 +33,14 @@ The per-category counts below are the catalog's. This crate links no evaluator f ## Evaluated functions -In this crate only the scalar core listed in `crates/dax/README.md` has an evaluator path: the -aggregations and their `*X` iterators, the logical spine, `CALCULATE`/`FILTER`/`ALL*`/`VALUES`/ -`DISTINCT`/`SELECTEDVALUE`, `RELATED*`, `COUNTROWS` and the text/math helpers the core switch -carries. Every other catalogued function reports "not implemented" until its evaluator family is -linked (`eval::FAMILIES` is empty here); each family PR adds its dispatch and its own suite under -`crates/dax/tests/`. The lists below are therefore the **catalog**, not a claim that this build -evaluates them. +In this crate the evaluator is `Evaluator::eval`'s built-in switch plus whatever `eval::FAMILIES` +links, and `FAMILIES` is empty here. The switch handles the aggregations and their `*X` iterators, +the logical spine, `CALCULATE`/`FILTER`/`ALL*`/`VALUES`/`DISTINCT`/`SELECTEDVALUE`, `RELATED*`, +`COUNTROWS`, the statement operators, and the scalar helpers it carries directly — `ABS`, `DATE`, +`LEN`, `PATHLENGTH` and the rest of the small scalar set in `crates/dax/src/eval.rs`. Every other +catalogued function reports "not implemented" until its evaluator family is linked; each family PR +adds its dispatch and its own suite under `crates/dax/tests/`. The lists below are therefore the +**catalog**, not a claim that this build evaluates every name in it. ## Catalogued (parsed and validated)