dbt-core icon indicating copy to clipboard operation
dbt-core copied to clipboard

[CT-1201] [Bug] Metrics don't require `expression` field

Open callum-mcdata opened this issue 3 years ago • 1 comments

Is this a new bug in dbt-core?

  • [X] I believe this is a new bug in dbt-core
  • [X] I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Ran into this behavior when working with a beta customer. Right now, we provide the default value of empty string ("") to the expression/sql field. That then gets provided to ParsedMetric where it recognizes this field as a string and accepts it, even if the field isn't defined in the metric.

Expected Behavior

If the expression field isn't present, the metric would fail to compile.

Steps To Reproduce

  1. Create a metric without a sql/expression field
  2. Compile/parse

callum-mcdata avatar Sep 16 '22 20:09 callum-mcdata

Thanks for the quick issue + PR Callum!

jtcohen6 avatar Sep 19 '22 11:09 jtcohen6