dbt converter loses derived metric time-context semantics in MetricFlow to Ossie conversion
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 64/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- data-engineering
Research direction
Locate the MetricFlow-to-Ossie derived-metric conversion and the existing CUMULATIVE_SEMANTICS_LOSS handling. Review the converter tests for derived metrics, then cover offset windows, offset-to-grain, rolling-window, and grain-to-date inputs. Done means a ConverterIssue identifies the affected metric whenever these semantics cannot be preserved.
Written by the indexing model from the issue text.
Description
Problem
The MetricFlow → Ossie converter can silently lose time-context semantics from derived metrics.
For example, a month-over-month metric can use an offset input:
- 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
The current converter flattens this into an ordinary Ossie SQL expression:
(SUM(orders.amount) - SUM(orders.amount)) / SUM(orders.amount)
The pre offset semantics are lost. A top-level cumulative metric emits CUMULATIVE_SEMANTICS_LOSS, but a derived metric using offset-period inputs does not emit an equivalent warning.
Expected behavior
The converter should report a ConverterIssue for derived metrics using non-portable time-context semantics, including offset_window, offset_to_grain, rolling windows, and grain-to-date semantics. The warning should identify the metric whose semantics were lost.
Strict mode could fail conversion instead of emitting a potentially misleading ordinary SQL expression.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 280
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 32
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/ossie
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100