Skip to content

Calculated measures lose description and metadata #257

@Luiscri

Description

@Luiscri

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions