dbt-labs / dbt-semantic-interfaces

The shared semantic layer definitions that dbt-core and MetricFlow use.
Apache License 2.0
66 stars 13 forks source link

Add & validate cumulative type params & period agg #288

Closed courtneyholcomb closed 2 months ago

courtneyholcomb commented 2 months ago

Resolves #289 Completes SL-2363 Completes SL-2364

Description

Move cumulative metric type params to a nested key within type_params called cumulative_type_params. Add new period_agg field with options FIRST, LAST, and AVERAGE. (Note we chose FIRST and LAST because that language aligns with the window function syntax we'll use for those - FIRST_VALUE and LAST_VALUE.) This will be used when aggregating cumulative metrics to non-default time granularities.

Checklist

linear[bot] commented 2 months ago

SL-2363 DSI: Add config option `period_agg` / `grain_agg`

SL-2364 Add `cumulative_type_params` to YAML spec

courtneyholcomb commented 2 months ago

@QMalcolm thank you for the thorough feedback! Just added a couple commits to add the transformation and update the validation if you want to take another look.

courtneyholcomb commented 2 months ago

Note: We have a release for 0.6.0 coming soon. This should not merge until after that release - otherwise users will get validation warnings for cumulative_type_params before those fields are actually supported in MF.