Is this a new bug in metricflow?
Current Behavior
This is how I have defined a measure. Notice the expr differs from the name.
- name: sum_github_commit_file_deletions
expr: commit_file_deletions
agg: sum
create_metric: true
description: Sum of GitHub commit file deletions
When I explain the metric with a simple command:
mf query --explain --metrics sum_github_commit_file_deletions
I get SQL code that is incorrect. It uses the measure name, not the expression in the aggregation. My table doesn't have a column called sum_github_commit_file_deletions, that's just the measure name.
SELECT
SUM(sum_github_commit_file_deletions) AS sum_github_commit_file_deletions
FROM `fact_github_commit_file` fact_github_commit_file_src_10000
Expected Behavior
The expected output is
SELECT
SUM(commit_file_deletions) AS sum_github_commit_file_deletions
FROM `fact_github_commit_file` fact_github_commit_file_src_10000
where the expression is used inside the aggregation.
Steps To Reproduce
Try it on any measure that has an expression (which is different from the measure name).
Relevant log output
Environment
Python: 3.12.11
dbt-databricks: 1.10.14
dbt-spark: 1.9.3
dbt-core: 1.10.13
metricflow 0.209.0
dbt-metricflow 0.11.0
Which database are you using?
other (mention it in "Additional Context")
Additional Context
Databricks