Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 1.6.latest] Support null coalescing properties for metric nodes (#8700) #8773

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

QMalcolm
Copy link
Contributor

@QMalcolm QMalcolm commented Oct 4, 2023

resolves #8593

THIS IS A BACKPORT OF #8700

Problem

MetricFlow is adding support for null value coalescing (dbt-labs/metricflow#759). In order to use that, dbt-core needs to support the related properties

Solution

Add the properties join_to_timespine and fill_nulls_with (as defined in the related MF and DSI issues: dbt-labs/metricflow#759, dbt-labs/dbt-semantic-interfaces#142) to the metric node definition.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

* Include 'join_to_timespine` and `fill_nulls_with` in metric fixture

* Support `join_to_timespine` and `fill_nulls_with` properties on measure inputs to metrics

* Assert new `fill_nulls_with` and `join_to_timespine` properties don't break associated DSI protocol

* Add doc for metric null coalescing improvements

* Fix unit test for unparsed metric objects

The `assert_symmetric` function asserts that dictionaries are mostly
equivalent. I say mostly equivalent because it drops keys that are
`None`. The issue is that that `join_to_timespine` gets defaulted
to `False`, so we have to specify it in the `get_ok_dict` so that
they match.
@QMalcolm QMalcolm requested a review from martynydbt October 4, 2023 21:19
@QMalcolm QMalcolm requested a review from a team as a code owner October 4, 2023 21:19
@cla-bot cla-bot bot added the cla:yes label Oct 4, 2023
@QMalcolm QMalcolm requested a review from a team as a code owner October 5, 2023 15:22
@QMalcolm QMalcolm requested review from ashnm and removed request for a team October 5, 2023 15:22
@QMalcolm QMalcolm merged commit 0a78a96 into 1.6.latest Oct 5, 2023
93 checks passed
@QMalcolm QMalcolm deleted the backport--8700-to-1.6.latest branch October 5, 2023 22:42
@aranke aranke mentioned this pull request Jul 12, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants