When a Measure has a compound expression (e.g. division of two aggregations), with_measures() decomposes it into a BinOp. The original Measure.description and Measure.metadata are discarded in this process. They don't appear in json_definition["measures"] nor on the objects returned by get_calculated_measures().
Expected behavior: All measures passed to with_measures() should preserve their description and metadata — regardless of expression complexity — and these should be accessible via json_definition["measures"] and/or a dedicated API.
Use case: We build an MCP server that exposes model schemas (dimensions + measures with descriptions/formats/units). Currently we have to monkey-patch with_measures() to capture metadata before BSL discards it.
Suggested fix: Include all measures in json_definition["measures"] with their full metadata, or at minimum attach description / metadata to the BinOp wrappers returned by get_calculated_measures().
When a Measure has a compound expression (e.g. division of two aggregations), with_measures() decomposes it into a BinOp. The original Measure.description and Measure.metadata are discarded in this process. They don't appear in json_definition["measures"] nor on the objects returned by get_calculated_measures().
Expected behavior: All measures passed to with_measures() should preserve their description and metadata — regardless of expression complexity — and these should be accessible via json_definition["measures"] and/or a dedicated API.
Use case: We build an MCP server that exposes model schemas (dimensions + measures with descriptions/formats/units). Currently we have to monkey-patch with_measures() to capture metadata before BSL discards it.
Suggested fix: Include all measures in json_definition["measures"] with their full metadata, or at minimum attach description / metadata to the BinOp wrappers returned by get_calculated_measures().