You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
I'm getting this error when querying a derived metric: ins.ValueError: Unknown metric: MetricReference(element_name='order_gross_profit') in element set. I noticed that the measures list in the semantic manifest is empty, which is likely causing the error:
@QMalcolm per our conversation today in standup we need to update the way we populate measures.
github-actionsbot
changed the title
Derived metrics throw an error when using the run based semantic manifest.
[CT-2707] Derived metrics throw an error when using the run based semantic manifest.
Jun 15, 2023
So what we haven't been doing is properly populating the measures attribute of metric type params (additionally measures on metric type params because input_measures once work for #7898 is merged). The input_measures can only get populated once all metrics have gone through initial parsing. This is because of derived metrics. If a derived metric depends on a metric that hasn't been parsed yet, then it won't be able to properly populate the input_measures. An example of how the logic for setting input_measures plays out can be found in dbt-semantic-interfaces' add_input_metric_measures.py transformation rule. I imagine the logic we used would be quite similar. If so we should longer term coordinate with the semantic layer team to abstract this logic in dbt-semantic-interfaces to make it more accessible.
Is this a new bug in dbt-core?
Current Behavior
I'm getting this error when querying a derived metric:
ins.ValueError: Unknown metric: MetricReference(element_name='order_gross_profit') in element set
. I noticed that the measures list in the semantic manifest is empty, which is likely causing the error:@QMalcolm per our conversation today in standup we need to update the way we populate measures.
Expected Behavior
I should be able to query derived metrics from the run based manifest.
Steps To Reproduce
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: