Open courtneyholcomb opened 1 week ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.77%. Comparing base (
ca163c3
) to head (96b79a8
). Report is 4 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Pulling out the yaml spec here:
- name: cumulative_orders
label: Rolling total of orders (all time)
type: cumulative
type_params:
measure: num_orders
cumulative_type_params:
period_agg: last
There is one thing we probably should change though. In the DSI counterpart (https://github.com/dbt-labs/dbt-semantic-interfaces/pull/288) we https://github.com/dbt-labs/dbt-semantic-interfaces/pull/288#pullrequestreview-2111135930. I think from that we are missing 2.b where in we populate the new paths from the old paths (iff the new paths aren't specified and the old paths are)
@QMalcolm ah ok! We are running the transformation in MF that should handle this. I didn't realize we would need to handle that in core, too. What's the reason for needing it in both places?
@QMalcolm ah ok! We are running the transformation in MF that should handle this. I didn't realize we would need to handle that in core, too. What's the reason for needing it in both places?
In a vacuum, if all we care about is the functionality working, then that would be correct. However, that isn't our only goal. Our additional goal is to move in the direction of deprecating and removing the old paths. In order for DSI to remove the old paths, we first need to reasonably guarantee that nearly all semantic manifests being consumed have the new paths set when applicable. There are four possible states for the new paths and old paths:
Currently, any core produced semantic manifest will produce (3). In order for DSI to ever remove the old paths (and the related transformations), we have to guarantee that semantic manifests being consumed by the MetricFlow / SL don't have state (3). So, although we don't technically need to do it now, we need to do it eventually. However, the longer we wait to do it, the longer DSI and Metricflow have to handle both states. Thus, doing it now means the tech debt we incur can be shorter lived and arguably more contained.
@QMalcolm Updated, and added tests for the old paths too.
resolves #10360
CumulativeTypeParams
DSI has recently moved fields related to cumulative metrics (specifically,
window
andgrain_to_date
) fromtype_params
totype_params.cumulative_type_params
. This creates better organization in the metric spec, and also adds a new field calledtype_params.cumulative_type_params.period_agg
which is used to re-aggregate cumulative metrics for non-default granularities. This PR adds core support for the new fields.Note that the old fields
type_params.window
andtype_params.grain_to_date
will still work, so this is not a breaking change. There is a transformation that runs in MetricFlow to copy the old fields into the new fields if the new fields are not set, and sets the defaultperiod_agg
value toPeriodAggregation.FIRST
if it's not already set in the manifest.Soon, setting the old fields will trigger a validation warning prompting users to move those values to the new fields. The plan is to eventually deprecate those fields.
Sub-Daily Granularities
Since the new sub-daily granularity options are included in the DSI version upgrade, this PR also adds support for those.
Notes
Checklist