Skip to content

v0.9.0

Choose a tag to compare

@github-actions github-actions released this 29 Oct 15:56
· 26 commits to main since this release
d46669d

Changelog

Added

  • Entities, marts and step-produced columns take a label:. An entity's label reaches
    the MetricFlow entity that stands for it, a mart's becomes MetricFlow's semantic model
    label and Cube's cube and view title, and a manifest's produces: column label
    reaches the output entity's column as a mapped field's does. No SQL changes, and
    changing one is metadata only in plan() and timeline(); a step whose column label
    changed is not restated. (#373)

  • A field mapping can set a constant. marketplace: {const: Wildberries} sets the field to
    one literal for every row the mapping lands, typed against the field's declaration when
    the project compiles and reading no source path. Two marketplaces feeding one merged
    entity each name their rows, and a single mapping can too. Lineage shows no source
    column for the field, and a value outside the field's type is refused with its path.
    (#375)

  • unit: ratio for a dimensionless factor. A canonical field holding a percentage, a
    VAT rate, a ±1 sign or a 0/1 flag declares unit: ratio, and like a count it carries no
    tax basis. So price * (100 - discount) / 100 - cost compiles instead of being refused
    as an unknown basis beside money, and price + discount is still a UnitMismatch.
    (#367)

  • A metric template can read a per-unit field of a many-to-one parent. A catalog field
    that is a rate rather than an amount, such as a product's unit cost, declares
    per_unit: true. A template at order-line grain can then compute
    product_cost * line_quantity: the grain guard admits the field read down one
    many-to-one relationship, and each mart reads the column it flattened the field into,
    under its own prefix. An amount of the parent, such as order shipping read per line, is
    refused as before. (#366)

  • A metric says which direction of change is good news. better: higher, lower or
    neither on a metric or its catalog template reaches MetricFlow as config.meta.better
    and Cube as the measure's meta.better, so a dashboard colouring a delta or reading a
    target on a cost as a ceiling takes it from the spec. A metric that does not say emits
    nothing, and a ratio or derived metric does not take it from its parts. No SQL changes.
    (#364)

Changed

  • bloomery_ir_version is 31. The IR gains MetricIR.better (#364), and EntityIR.label,
    MartIR.label and StepColumnIR.label (#373). Every project re-fingerprints once on
    upgrade, and plan() refuses to diff an artifact set compiled by 0.8 against one compiled
    by this version: re-baseline after upgrading.

Fixed

  • A relationship may name a step output, so a mart can flatten what a step computes,
    such as revenue by the buyer's segment. Its via columns are checked against the step's
    produces, and a referential rule or coverage: check through one is refused when
    the step reads the dependent entity, a cycle. (#362)

  • Two entities whose referential rules join each other are refused. Each rule is a
    LEFT JOIN inside its entity's model, so the pair compiled to two models that each read
    the other, which no engine can build. The refusal names the chain of reads. (#363)

  • Lineage runs through a sql_model step. resolve() takes the step registry as
    steps=, and with it the graph draws the step to each column it produces, a metric over
    a step output to the columns its expr reads, and a step reading another step's output
    from each of that output's columns. A walk from a step's input now reaches the metrics
    over its output, and back. Without a registry, as in bloomery lineage, the graph is as
    before. (#365)

  • A metric template's filter and semi_additive.over read the project's columns. Both
    were read as one project's literal column names, so a template filtering on
    deal_outcome or reading a snapshot over stock_at could not be used by a project
    that spells those columns otherwise. A filter name that no mart listing the metric
    carries, or an over the grain entity has no column for, now reads the one grain column
    that links it as its canonical, as the template's expr already did. A name that is
    already a column keeps it, so every spec that compiled reads what it read. (#368)