Skip to content

fix(dbt): warn on non-portable metric semantics - #318

Open
fanruan-tuco wants to merge 1 commit into
apache:mainfrom
fanruan-tuco:fix/317-time-context-semantics
Open

fix(dbt): warn on non-portable metric semantics#318
fanruan-tuco wants to merge 1 commit into
apache:mainfrom
fanruan-tuco:fix/317-time-context-semantics

Conversation

@fanruan-tuco

Copy link
Copy Markdown
Contributor

Summary

MetricFlow time-context semantics such as cumulative metrics, windows, time spine behavior, and offset-period inputs cannot be represented faithfully in Ossie. This change emits NON_PORTABLE_METRIC_SEMANTICS instead of silently producing a lossy conversion.

It also checks derived and ratio dependencies recursively, including cases such as:

- name: month_over_month_growth
  type: derived
  type_params:
    expr: (cur - pre) / pre
    metrics:
      - name: revenue
        alias: cur
      - name: revenue
        alias: pre
        offset_window:
          count: 1
          granularity: month

Fixes #317

Validation

uv run pytest -q in converters/dbt: 103 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dbt converter loses derived metric time-context semantics in MetricFlow to Ossie conversion

1 participant