1.4.0 - Performance Improvements
New Features
- Even in the original issue for metrics, there were users suggesting that timestamps should be an optional property and that some metrics can't be time-bound. This was deprioritized during the initial implementation but with the release of dbt-core 1.4, we've made this a reality! Metric timestamps (and time_grains) are now an optional property of a metric and the metric macros can now calculate metrics without needing to provide a grain.
grain
is now an optional input to the metrics macros and if it is not present then the generated SQL will aggregate the metric without any consideration for time. PR for the curious- This piece of work changes the SQL generation to ensure that there won't be 0 values for dimensions that don't have values on the particular date. If you're familiar with the way we generate sql, it means we're no longer date-spining fields unless it is required by the query.
- Median has been the top requested calculation method for the past year. So we decided to sprinkle in some post-holiday presents and release it as part of 1.4! For more information on how we implemented this, especially for data platforms that don't have a median aggregation, see the PR.
- Adding date-alias input to macro in order to support BI tools that require statically named columns by @callum-mcdata in #209
New Supported Adapters
- With the introduction of dbt-databricks support in dbt Cloud, we wanted to make sure that dbt_metrics had parity! Databricks is now a supported adapter for dbt_metrics.
Bug Fixes/Small Improvements
- Making metrics queries more performant by looping through common groups instead of metrics @callum-mcdata in #211
- Code cleanup (re: issue #144) by @deanna-minnick in #189
- Reducing Order By Complexity by @callum-mcdata in #191
- Hotfixing misnamed variable by @callum-mcdata in #207
New Contributors
- The wonderful @atomatize made their first contribution with a documentation fix
- The documentation guru with eagle eyes @mirnawong1 spotted some mistakes and made fixes!
Full Changelog: 1.3.2...1.4.0rc1