dbt-core
dbt-core copied to clipboard
[CT-1201] [Bug] Metrics don't require `expression` field
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
- Create a metric without a sql/expression field
- Compile/parse
Thanks for the quick issue + PR Callum!